funnel_sequence_completion plugin

Learn how to use the funnel_sequence_completion plugin to calculate a funnel of completed sequence steps while comparing different time periods.

Calculates a funnel of completed sequence steps while comparing different time periods. The plugin is invoked with the evaluate operator.

Syntax

T | evaluate funnel_sequence_completion(IdColumn, TimelineColumn, Start, End, BinSize, StateColumn, Sequence, MaxSequenceStepWindows)

Parameters

NameTypeRequiredDescription
Tstring✔️The input tabular expression.
IdColumstring✔️The column reference representing the ID. The column must be present in T.
TimelineColumnstring✔️The column reference representing the timeline. The column must be present in T.
Startdatetime, timespan, or long✔️The analysis start period.
Enddatetime, timespan, or long✔️The analysis end period.
BinSizedatetime, timespan, or long✔️The analysis window size. Each window is analyzed separately.
StateColumnstring✔️The column reference representing the state. The column must be present in T.
Sequencedynamic✔️An array with the sequence values that are looked up in StateColumn.
MaxSequenceStepPeriodsdynamic✔️An array with the values of the max allowed timespan between the first and last sequential steps in the sequence. Each period in the array generates a funnel analysis result.

Returns

Returns a single table useful for constructing a funnel diagram for the analyzed sequence:

  • TimelineColumn: the analyzed time window (bin), each bin in the analysis timeframe (Start to End) generates a funnel analysis separately.
  • StateColumn: the state of the sequence.
  • Period: the maximal period allowed for completing steps in the funnel sequence measured from the first step in the sequence. Each value in MaxSequenceStepPeriods generates a funnel analysis with a separate period.
  • dcount: distinct count of IdColumn in time window that transitioned from first sequence state to the value of StateColumn.

Examples

The following examples show how to use the funnel_sequence_completion plugin to analyze storm events. The query checks the completion funnel of the sequence: Hail -> Tornado -> Thunderstorm Wind in “overall” time of 1hour, 4hours, 1day.

let _start = datetime(2007-01-01);
let _end =  datetime(2008-01-01);
let _windowSize = 365d;
let _sequence = dynamic(['Hail', 'Tornado', 'Thunderstorm Wind']);
let _periods = dynamic([1h, 4h, 1d]);
StormEvents
| evaluate funnel_sequence_completion(EpisodeId, StartTime, _start, _end, _windowSize, EventType, _sequence, _periods) 

Output

StartTimeEventTypePerioddcount
2007-01-01 00:00:00.0000000Hail01:00:002877
2007-01-01 00:00:00.0000000Tornado01:00:00208
2007-01-01 00:00:00.0000000Thunderstorm Wind01:00:0087
2007-01-01 00:00:00.0000000Hail04:00:002877
2007-01-01 00:00:00.0000000Tornado04:00:00231
2007-01-01 00:00:00.0000000Thunderstorm Wind04:00:00141
2007-01-01 00:00:00.0000000Hail1.00:00:002877
2007-01-01 00:00:00.0000000Tornado1.00:00:00244
2007-01-01 00:00:00.0000000Thunderstorm Wind1.00:00:00155

Understanding the results:
The outcome is three funnels (for periods: One hour, 4 hours, and one day). For each funnel step, a number of distinct counts of are shown. You can see that the more time is given to complete the whole sequence of Hail -> Tornado -> Thunderstorm Wind, the higher dcount value is obtained. In other words, there were more occurrences of the sequence reaching the funnel step.