SELECT uid, retention(date = '2020-01-01', date = '2020-01-02', date = '2020-01-03') AS r FROM retention_test WHERE date IN ('2020-01-01', '2020-01-02', '2020-01-03') GROUP BY uid ORDER BY uid ASC
This sql only calculates the last two days of retention on the day of 2020-01-01, if you also want to calculate the last two days of retention on 2020-01-02?
SELECT uid, retention(date = '2020-01-01', date = '2020-01-02', date = '2020-01-03') AS r, retention(date = '2020-01-02', date = '2020-01-03', date = '2020-01-04') AS r2 FROM retention_test WHERE date IN ('2020-01-01', '2020-01-02', '2020-01-03') GROUP BY uid ORDER BY uid ASC
Do that?
Is there another way? I appreciate it very much!!!
SELECT uid, retention(date = '2020-01-01', date = '2020-01-02', date = '2020-01-03') AS r FROM retention_test WHERE date IN ('2020-01-01', '2020-01-02', '2020-01-03') GROUP BY uid ORDER BY uid ASCThis sql only calculates the last two days of retention on the day of 2020-01-01, if you also want to calculate the last two days of retention on 2020-01-02?
SELECT uid, retention(date = '2020-01-01', date = '2020-01-02', date = '2020-01-03') AS r, retention(date = '2020-01-02', date = '2020-01-03', date = '2020-01-04') AS r2 FROM retention_test WHERE date IN ('2020-01-01', '2020-01-02', '2020-01-03') GROUP BY uid ORDER BY uid ASCDo that?
Is there another way? I appreciate it very much!!!