使用 Adobe Analytics 数据计算 BQ 中的访问量
Calculate visits in BQ using Adobe Analytics data
我试图通过从 Big Query 中的 Adobe Analytics 提取原始数据来计算每天的总访问次数。我在编写 SQL 查询方面的技能有限,因此,如果有人能指出我做错了什么,我将不胜感激。
查询:
SELECT EXTRACT(DATE FROM date_time) AS Day,
CONCAT(visid_high, "-", visid_low, "-", visit_start_time_gmt) AS visits
FROM `adobe_data.table1` WHERE date_time > '2019-05-01' AND date_time < '2019-05-30'
AND page_event = '0'
AND exclude_hit = '0'
GROUP by Day;
我得到的错误是:“Select 列表表达式列 visits_high 既不分组也不聚合。”
注意:我不想按 'visits' 分组,我想按 'Day' 获取访问量(例如 2019-05-01,访问量为 12555)。
您需要第二个表达式的聚合函数。也许:
SELECT EXTRACT(DATE FROM date_time) AS Day,
ARRAY_AGG(CONCAT(visid_high, '-', visid_low, '-', visit_start_time_gmt)) AS visits
FROM `adobe_data.table1`
WHERE date_time > '2019-05-01' AND date_time < '2019-05-30' AND
page_event = '0' AND
exclude_hit = '0'
GROUP by Day;
我试图通过从 Big Query 中的 Adobe Analytics 提取原始数据来计算每天的总访问次数。我在编写 SQL 查询方面的技能有限,因此,如果有人能指出我做错了什么,我将不胜感激。
查询:
SELECT EXTRACT(DATE FROM date_time) AS Day,
CONCAT(visid_high, "-", visid_low, "-", visit_start_time_gmt) AS visits
FROM `adobe_data.table1` WHERE date_time > '2019-05-01' AND date_time < '2019-05-30'
AND page_event = '0'
AND exclude_hit = '0'
GROUP by Day;
我得到的错误是:“Select 列表表达式列 visits_high 既不分组也不聚合。”
注意:我不想按 'visits' 分组,我想按 'Day' 获取访问量(例如 2019-05-01,访问量为 12555)。
您需要第二个表达式的聚合函数。也许:
SELECT EXTRACT(DATE FROM date_time) AS Day,
ARRAY_AGG(CONCAT(visid_high, '-', visid_low, '-', visit_start_time_gmt)) AS visits
FROM `adobe_data.table1`
WHERE date_time > '2019-05-01' AND date_time < '2019-05-30' AND
page_event = '0' AND
exclude_hit = '0'
GROUP by Day;