Ramakrishnan M
Ramakrishnan M

Reputation: 311

How to query firebase event report with hourly breakup in Bigquery?

Below big query helps to extract registration event data datewise. But, How to extract registration event data hourwise. Pls. Help

select 
app_info.id,app_info.version,traffic_source.medium,
traffic_source.source,geo.country,geo.city,  
event_date,event_name, 
  param1.value.string_value as category,
 FROM `<Table>`,
UNNEST(event_params) as param1
where _TABLE_SUFFIX BETWEEN '20190401'  AND '20190402'  
and event_name='Registration'
and param1.key='category' 
group by 1,2,3,4,5,6,7,8,9

Upvotes: 0

Views: 617

Answers (1)

Alex
Alex

Reputation: 5276

in your select change event_date to TIMESTAMP_TRUNC(TIMESTAMP_MICROS(event_timestamp), HOUR)

Upvotes: 1

Related Questions