Created
September 27, 2021 14:23
-
-
Save ddikman/f82154a18719eb399e8591bba987e686 to your computer and use it in GitHub Desktop.
Getting average order price per platform
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 | |
platform, | |
avg(p.value.double_value) as avg_value, | |
count(distinct(user_pseudo_id)) as views, | |
DATE_TRUNC(DATETIME(TIMESTAMP_MICROS(event_timestamp)), MONTH) as month | |
FROM `<project>.analytics_<id>.events_*`, | |
unnest(event_params) p | |
where event_name = 'view_item' and p.key = 'value' | |
group by month, platform | |
order by month, platform |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment