I used the same logic to unnest hit.eCommerceAction, but it\'s not working as other fields. Any help on this problem? Also, Is the max(if()) function the right function to use t
I can reproduce the error with a simpler query:
#standardSQL
SELECT DISTINCT hit.eCommerceAction.action_type
FROM `73156703.ga_sessions_20170109` t
, UNNEST(hits) hit
, UNNEST(hit.customDimensions) customDimensions
, UNNEST(hit.eCommerceAction) as eCommerceAction
The issue here is that eCommerceAction
is not a REPEATED
record, hence there is no array to UNNEST
.
Fixed query:
#standardSQL
SELECT DISTINCT hit.eCommerceAction.action_type
FROM `ga_sessions_20170109` t
, UNNEST(hits) hit
, UNNEST(hit.customDimensions) customDimensions