-
-
Save ivanpk/fb84a2c4a8550bd2cf49361d3b559ce1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH daily AS ( | |
SELECT | |
DATE(created_at) day, | |
user_id | |
FROM | |
`example-project.ivan.article_example_dataset` | |
) | |
SELECT | |
day, | |
SUM(APPROX_COUNT_DISTINCT(user_id)) OVER (ORDER BY day ROWS BETWEEN 89 PRECEDING AND CURRENT ROW) ninty_day_window_approx | |
FROM | |
daily | |
GROUP BY | |
1 | |
ORDER BY | |
1 DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment