如果我没记错的话,计算当天的活跃用户应该很简单。只需要今天的和谐x天退(7天有效6天退),然后计算不同的ID。我有一个为期两天的活跃用户查询: 4 y1 a" }) \# j, w$ lWITH allTables AS ( SELECT CONCAT(user_dim.app_info.app_id,':',user_dim.app_info.app_platform) AS app, event.date, user_dim.app_info.app_instance_id as users FROM `dataset.app_events_intraday_20170407` CROSS JOIN UNNEST(event_dim) AS event UNION ALL SELECT CONCAT(user_dim.app_info.app_id,':',user_dim.app_info.app_platform) AS app, event.date, user_dim.app_info.app_instance_id as users FROM `dataset.app_events_20170406` CROSS JOIN UNNEST(event_dim) AS event) SELECT COUNT(DISTINCT(users)) AS unique, COUNT(users) as totalFROM allTables这是为期两天的活动,但对于7天或30天,我只需要合并所有这些表格。这是正确的还是需要修改的?; \: K. ]0 z2 I' c- _, d
- t. r- C8 d! r 解决方案: