How can I implement the funnel_sequence plugin taking in a parameter for the Sequence-value

Bendik Nag 0 Reputation points
2023-10-19T14:26:52.5+00:00
let ViewSelect = 'index.dashboards'; ###Parameter from dashboard dropdown 
let seq = iff(ViewSelect=='index.dashboards', dynamic(['index.dashboards']), dynamic(['']));
let FunnelStartDate = ago(1d);
let FunnelEndDate = now();
pageViews
| extend timestamp = ingestion_time()
| where timestamp between (FunnelStartDate .. FunnelEndDate) and isnotempty(user_AuthenticatedId)
| evaluate funnel_sequence(session_Id, timestamp, FunnelStartDate, FunnelEndDate, 10m, 365d, name, seq)


let seq= dynamic(['index.dashboards']);
let FunnelStartDate = ago(1d);
let FunnelEndDate = now();
pageViews
| extend timestamp = ingestion_time()
| where timestamp between (FunnelStartDate .. FunnelEndDate) and isnotempty(user_AuthenticatedId)
| evaluate funnel_sequence(session_Id, timestamp, FunnelStartDate, FunnelEndDate, 10m, 365d, name, seq)

The first example does not work and gives this error: evaluate funnel_sequence(): argument #8 expected to be a constant dynamic array. Why is there any difference between the two? At the point where the code is running the seq variable has already taken its value and is not changing without the user input changing. It would make the funnel_sequence plugin way more flexible if this was possible.

Please help :)

Azure Data Explorer
Azure Data Explorer
An Azure data analytics service for real-time analysis on large volumes of data streaming from sources including applications, websites, and internet of things devices.
576 questions
{count} votes

2 answers

Sort by: Most helpful
  1. QuantumCache 20,366 Reputation points Moderator
    2023-10-19T22:19:54.8066667+00:00

    @Bendik Nag
    Thank for the quick response. I am trying to help you to my best! Please correct me if needed.
    Did you try using a combination of let statements and dynamic arrays?

    let ViewSelect = dashboard_parameter('ViewSelect');
    let seq = dynamic([ViewSelect]);
    let FunnelStartDate = ago(1d);
    let FunnelEndDate = now();
    pageViews
    | extend timestamp = ingestion_time()
    | where timestamp between (FunnelStartDate .. FunnelEndDate) and isnotempty(user_AuthenticatedId)
    | evaluate funnel_sequence(session_Id, timestamp, FunnelStartDate, FunnelEndDate, 10m, 365d, name, seq)
    | order by dcount desc 
    | project-away samples, timestamp
    
    0 comments No comments

  2. Bendik Nag 0 Reputation points
    2023-10-20T06:52:10.86+00:00

    SatishBoddu-MSFT

    Yes, this gives an error in the console:

    failed to query Draft resource name: osrprod, resource id: 1f30852d-5d87-491b-87c3-0ee46baabc62; (inner error: {"code":"Bad Request","message":"{"error":{"message":"The request had some invalid properties","code":"BadArgumentError","correlationId":"9d570aec-f0fe-491f-9418-2668554861e1","innererror":{"code":"SyntaxError","message":"A recognition error occurred in the query.","innererror":{"code":"SYN0002","message":"Query could not be parsed at 'ViewSelect' on line [7,109]","line":7,"pos":109,"token":"ViewSelect"}}}}"})

    and this error in the code:

    User's image

    even though there is no ], ) or , missing in the full expression.

    Btw, thank you for taking your time answering!


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.