用子句将Google Analytics(分析)连接到Bigquery并返回null

时间:2018-10-18 04:32:18

标签: google-analytics google-bigquery concat

我正在尝试子查询来选择我的Google Analytics(分析)数据。附件是我的查询如下:

    with subQ_googleanalytics AS(
select date(timestamp_micros(visitstarttime*1000000)) as GA_date
, fullvisitorID as GA_visitorID
, safe_cast(userid as string) as GA_userid
, totals.visits  as GA_interactionTF
, concat(safe_cast(fullvisitorid as string), safe_cast(userid as string), safe_cast(totals.visits as string)) as akandicount
from `43864393.ga_sessions_*` 
where _TABLE_SUFFIX between
FORMAT_DATE("%Y%m%d", DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)) 
AND FORMAT_DATE("%Y%m%d", DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY)
))

select *
from subQ_googleanalytics

但是,它在null字段中返回akandicount enter image description here

我想通过使用子查询来计数会话。这是否意味着concat不能与With子句一起使用?

0 个答案:

没有答案