Created
December 20, 2021 12:32
-
-
Save ddikman/d05aeaea3b0eb8f7fb120c732724e307 to your computer and use it in GitHub Desktop.
Gets the app opens for the app over the past few weeks
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
SELECT | |
DATE(DATE_TRUNC(TIMESTAMP_MICROS(event_timestamp), WEEK)) as week, | |
COUNT(DISTINCT(user_pseudo_id)) as users | |
FROM `<project>.events_*` | |
WHERE event_name = 'app_open' | |
-- past six weeks | |
AND DATE(DATE_TRUNC(TIMESTAMP_MICROS(event_timestamp), WEEK)) > DATE_SUB(DATE_TRUNC(CURRENT_DATE(), WEEK), INTERVAL 6 WEEK) | |
GROUP BY week | |
ORDER BY week |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment