i want to get the following schema out of my GA BigQuery data: Hostname; customDimension2; customDimensions3; PageViews; ScreenViews; TotalEvents; Sessions
At first i just want to get the Hostname and cd2 my query look like the following:
SELECT hits.page.hostname, hits.customDimensions.value
FROM `dataset`, UNNEST(hits) as hits
WHERE hits.customDimensions.index = 2
LIMIT 1000
I get the following Error:
Cannot access field index on a value with type ARRAY<STRUCT<index INT64, value STRING>> at [1:162]
So how can i handle two different BigQuery Arrays?