Probably a beginner question, but I just couldn't find a soultion here.
I want to export different events (only the total events metric) in BigQuery from my google analytics account
So f.e. I have a download event and a search event, and I want to have each in one column, showing me the total events metric for each event. I filtered both events for different conditions, to make sure I have the correct event.
I'm using LegacySQL here and want to export all data from the same table. Problem is, that there is no subselect allowed in LegacySQL, any thoughts on how I can solve this?
SELECT clientId, totals.timeOnSite, trafficSource.source,
(SELECT hits.eventInfo.eventAction FROM (TABLE_DATE_RANGE([xxxxxx.ga_sessions_], TIMESTAMP('2018-11-25'), TIMESTAMP('2018-11-25'))) WHERE hits.eventInfo.eventCategory = 'Download' AND hits.type = 'EVENT' AND hits.eventInfo.eventAction = 'pdf') AS DownloadEvent,
(SELECT hits.eventInfo.eventLabel FROM (TABLE_DATE_RANGE([xxxxxx.ga_sessions_], TIMESTAMP('2018-11-25'), TIMESTAMP('2018-11-25'))) WHERE hits.eventInfo.eventLabel = 'search-header' OR 'search-mainpage' AND hits.type = 'EVENT') AS SearchEvent,
COUNT(1) eventHits FROM (TABLE_DATE_RANGE([xxxxxx.ga_sessions_], TIMESTAMP('2018-11-25'), TIMESTAMP('2018-11-25')))