Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Getting average order price per platform
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