在下面的查询中,我想显示该用户的电子邮件ID和唯一用户ID。
customEvents
//| where customDimensions.UserId == 'Error'
| where timestamp > ago(2d)
| summarize values = dcount(tostring(customDimensions.UserId)) by tostring(customDimensions.email)
数据:
UserId email
1 someone@x.com
Error someone@x.com
2 other@x.com
3 otherother@x.com
Error otherother@x.com
预期输出:
someone@x.com. 1, Error
other@x.com 2
otherother@x.com 3, Error
你可以试试这个:
datatable(UserId:string, Email:string)
[
'1', 'someone@x.com',
'Error', 'someone@x.com',
'2', 'other@x.com',
'3', 'otherother@x.com',
'Error', 'otherother@x.com',
]
| summarize UserIds = strcat_array(make_set(UserId), ", ") by Email