Skip to content

Instantly share code, notes, and snippets.

@cgi-ace
Created June 15, 2021 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgi-ace/f5a35f0c0ef3c5697427da2965086303 to your computer and use it in GitHub Desktop.
Save cgi-ace/f5a35f0c0ef3c5697427da2965086303 to your computer and use it in GitHub Desktop.
---- UNNEST Function example for Quick_play users
SELECT count(distinct user_pseudo_id) user_count ,
(SELECT value.string_value FROM UNNEST(user_properties) where key= 'plays_quickplay') as quick_play_flag ,
PARSE_DATE('%Y%m%d', event_date) as event_date,
geo.country,
device.operating_system
from `firebase-public-project.analytics_153293282.events_*`
where _TABLE_SUFFIX ='20180821'
group by event_date,quick_play_flag,geo.country,device.operating_system
order by geo.country,device.operating_system
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment