WINDOW_FUNNEL (Lakehouse v2)
時間順のシーケンスからイベントチェーンを検索し、最大のチェーン長を返します。
Analyzeの構文
Section titled “Analyzeの構文”func.window_funnel(86400, get_column(table, 'ts'), cond1, cond2)Analyzeの例
Section titled “Analyzeの例”func.window_funnel(86400, get_column(table, 'event_time'), get_column(table, 'step1'), get_column(table, 'step2'))SQLの構文
Section titled “SQLの構文”WINDOW_FUNNEL(86400, <ts>, cond1, cond2)SELECT user_id, WINDOW_FUNNEL(86400, event_time, event = 'view', event = 'cart', event = 'purchase')FROM user_events GROUP BY user_id;
┌─────────┬─────────────────┐│ user_id │ window_funnel │├─────────┼─────────────────┤│ 1 │ 3 ││ 2 │ 2 ││ 3 │ 1 │└─────────┴─────────────────┘