BigQuery to access CustomDimensions with new SQL syntax
I am migrating to the new SQL syntax in BigQuery as it looks more flexible. However, I am a bit stuck when it comes to fields in customDimensions. I am writing something very simple:
SELECT
cd.customDimensions.index,
cd.customDimensions.value
FROM `xxxxx.ga_sessions_20170312`, unnest(hits) cd
limit 100
But I am getting error
Error: Cannot access field index on a value with type ARRAY<STRUCT<index INT64, value STRING>>
However, if I run something like this, it works great:
SELECT
date,
SUM((SELECT SUM(latencyTracking.pageLoadTime) FROM UNNEST(hits))) pageLoadTime,
SUM((SELECT SUM(latencyTracking.serverResponseTime) FROM UNNEST(hits))) serverResponseTime
FROM `xxxxxx.ga_sessions_20170312`
group by 1
Is there some other logic when it comes to requesting customDimensions?
+3
source to share