【发布时间】:2016-05-13 07:00:10
【问题描述】:
我正在尝试在 Google BigQuery 中查询多个产品范围的自定义维度。结果是这样的:
我想获得结果中的组合行,如下所示:
这可以通过 BigQuery 中的查询实现吗?
编辑
请查看我使用的现有查询:
SELECT IF(hits.product.customDimensions.index=21, hits.product.customDimensions.value, NULL) cd21,
IF(hits.product.customDimensions.index=22,
hits.product.customDimensions.value, NULL) cd22
FROM [<table_id>.ga_sessions_20160510]
WHERE hits.product.productListName LIKE "%test%"
AND hits.product.isImpression IS TRUE
AND hits.product.customDimensions.index IN (21,22)
【问题讨论】:
-
请分享您现有的查询,以便我们改进它。
-
请查看我使用的现有查询:SELECT IF(hits.product.customDimensions.index=21, hits.product.customDimensions.value, NULL) cd21, IF(hits.product.customDimensions. index=22, hits.product.customDimensions.value, NULL) cd22 FROM [
.ga_sessions_20160510] 其中 hits.product.productListName LIKE "%test%" AND hits.product.isImpression 为真并且 hits.product.customDimensions。索引 IN (21,22)
标签: sql google-bigquery