RETENTION (Lakehouse v2)
Calcula a retenção para um conjunto de eventos. Retorna um array de 0s e 1s.
Sintaxe do Analyze
Seção intitulada “Sintaxe do Analyze”func.retention(cond1, cond2)Exemplos do Analyze
Seção intitulada “Exemplos do Analyze”func.retention(get_column(table, 'day1'), get_column(table, 'day2'))Sintaxe SQL
Seção intitulada “Sintaxe SQL”RETENTION(cond1, cond2)Exemplos SQL
Seção intitulada “Exemplos SQL”SELECT uid, RETENTION(dt='2024-01-01', dt='2024-01-02', dt='2024-01-03')FROM events GROUP BY uid;
┌─────┬────────────┐│ uid │ retention │├─────┼────────────┤│ 1 │ [1,1,0] ││ 2 │ [1,0,0] ││ 3 │ [1,1,1] │└─────┴────────────┘