我有一个查询,提取表单的用户名称列表: 日期,用户名,campaign_id,
campaign_id有一个唯一性,即用户每个广告系列每天只能点击一次(广告系列ID不能在一天内为同一用户记录两次)
我的问题是如何每月提取一个独特的活跃用户列表?对于不同的广告系列和不同的日期,用户可以多次登录。
customEvents
| extend rTimeStamp = todatetime(customDimensions.timeStamp),
username = tolower(tostring(customDimensions.username)),
event = name, item_uid = tostring(customDimensions.itemId)
| extend rTimeStamp = todatetime(substring(tostring(rTimeStamp), 0, 10))
| where event == 'click'
| project rTimeStamp, username, event, item_uid
| summarize arg_min(rTimeStamp, *) by item_uid, username
| summarize click_count = countif(event == 'click') by rTimeStamp, username, item_uid
| order by rTimeStamp
答案 0 :(得分:3)
使用“distinct”运算符:
...
| distinct username
如果您想要每个月的不同用户列表,也可以使用摘要:
...
| summarize by username, bin(rTimeStamp, 30d)