Google ビッグ クエリでのカスタム ディメンションの抽出について質問を受けました。この質問はすでに何人かの人々によってすでに尋ねられていますが、解決策は機能していません..
問題は、このようなカスタム ディメンションの情報を抽出しようとしたときです。
SELECT
fullvisitorId,
visitid,
hit.hitnumber,
(SELECT x.value FROM UNNEST(hit.customDimensions) x WHERE x.index = 1) as productCategory,
(SELECT x.value FROM UNNEST(hit.customDimensions) x WHERE x.index = 2) as loyaltyClass,
(SELECT x.value FROM UNNEST(hit.customDimensions) x WHERE x.index = 3) as existingCustomer
FROM [<id>.ga_sessions_20180805],UNNEST(hits) as hit
LIMIT 100
次に、「テーブル名「ヒット」を解決できません: データセット名がありません」というエラーが表示されました。
このような他の人からのソリューションを使用しようとしました
SELECT
fullvisitorId,
visitid,
hit.hitnumber,
(SELECT x.value FROM UNNEST(hit.customDimensions) x WHERE x.index = 1) as productCategory,
(SELECT x.value FROM UNNEST(hit.customDimensions) x WHERE x.index = 2) as loyaltyClass,
(SELECT x.value FROM UNNEST(hit.customDimensions) x WHERE x.index = 3) as existingCustomer
FROM `<id>.ga_sessions_*`, UNNEST(hits) AS h
WHERE _TABLE_SUFFIX = '20180805'
その後、別のエラー Invalid table name: <id>.ga_sessions_*
[Try using standard SQL ( https://cloud.google.com/bigquery/docs/reference/standard-sql/enabling-standard-sql)]が発生しました。
更新:最も基本的なクエリも試しました
SELECT
*
FROM [<id>.ga_sessions_20180805]
LEFT JOIN UNNEST(hits) as hits
LIMIT 10
それでも同じエラーが返されます....
両方のスクリプトで発生したエラーは何ですか? また、カスタム ディメンション値を取得するにはどうすればよいですか?
どうもありがとう!