Google analytics 如何使用WHERE子句中的hits.customDimensions.index查询GA导出到BQ模式?

Google analytics 如何使用WHERE子句中的hits.customDimensions.index查询GA导出到BQ模式?,google-analytics,google-bigquery,Google Analytics,Google Bigquery,几天前,以下查询在BQ上运行良好: 现在,我得到以下错误: Error: Cannot query the cross product of repeated fields customDimensions.index and hits.customDimensions.index. 有趣的是,下面的查询可以正常工作(即没有WHERE子句): 此外,以下查询也可以正常工作: SELECT hits.customDimensions.value FROM [88399188.ga_session

几天前,以下查询在BQ上运行良好:

现在,我得到以下错误:

Error: Cannot query the cross product of repeated fields customDimensions.index and hits.customDimensions.index.
有趣的是,下面的查询可以正常工作(即没有WHERE子句):

此外,以下查询也可以正常工作:

SELECT hits.customDimensions.value
FROM [88399188.ga_sessions_20150623]
WHERE hits.customDimensions.index=14
LIMIT 1000

请注意,FROM子句是此查询与失败查询之间的唯一区别;即使它们应该解析为完全相同的查询。请帮忙!我做错了什么?

问题是两个自定义维度都是重复记录,点击次数都是重复记录,并且每个维度都可以独立于其他维度重复。因此,在筛选hits.customDimensions.index时选择hits.customDimensions.value的含义并不明确。例如,如果希望在hits.customDimensions.index中的non为14时跳过整个记录,则可以使用以下查询:

SELECT hits.customDimensions.value
FROM TABLE_DATE_RANGE(
     [88399188.ga_sessions_], TIMESTAMP('20150623'), TIMESTAMP('20150623')
OMIT RECORD IF EVERY(hits.customDimensions.index != 14)
LIMIT 1000

这种异常不再是可复制的。虽然我还没有得到谷歌的确认,但我不得不假设这是一个暂时的错误,已经得到了修复

那么,我问题中的最后一个问题为什么有效?它不仅仅是含糊不清的吗?您上次的查询使用了相同的重复组hits.customDimensions,并从中选择了两个字段-index和value。由于它们一起重复,所以不存在为哪个索引选择哪个值的模糊性。但这两个字段与我在第一个失败的查询中使用的字段完全相同。第一个查询和最后一个查询之间的唯一区别是应该解析为同一个表的FROM子句。我一定误读了您的原始问题,因为某种原因,我认为您使用了customDimensions和hits.customDimensions的混合。如果您只使用hits.customDimensions,那么包括第一个查询在内,一切都正常。看起来有一个暂时的错误现在已经修复。
SELECT hits.customDimensions.value
FROM [88399188.ga_sessions_20150623]
WHERE hits.customDimensions.index=14
LIMIT 1000
SELECT hits.customDimensions.value
FROM TABLE_DATE_RANGE(
     [88399188.ga_sessions_], TIMESTAMP('20150623'), TIMESTAMP('20150623')
OMIT RECORD IF EVERY(hits.customDimensions.index != 14)
LIMIT 1000