Created
March 28, 2024 06:09
-
-
Save lfy79001/dd2a42832fcf19dac3371b58010d70d6 to your computer and use it in GitHub Desktop.
ga4.sql
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 ANY_VALUE(board_type) as board, AVG(score) as average_score | |
FROM ( | |
SELECT MAX(if(param.key = "value", param.value.int_value, NULL)) AS score, | |
MAX(if(param.key = "board", param.value.string_value, NULL)) AS board_type | |
FROM ( | |
SELECT user_pseudo_id, event_timestamp, param | |
FROM `firebase-public-project.analytics_153293282.events_20180915`, | |
UNNEST(event_params) AS param | |
WHERE event_name = "level_complete_quickplay" | |
AND (param.key = "value" OR param.key = "board") | |
) | |
GROUP BY user_pseudo_id, event_timestamp | |
) | |
GROUP BY board_type |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment