I have a query that pulls a list of user engements of the form: Date, user name, campaign_id,
There is uniqueness in the campaign_id in a sense that a user clicks only once per day per campaign_id (campaign id cant be logged twice for the same user within a day)
My question is how do I pull a list of unique active users per month? A user can be logged more than once for different campaigns and different days.
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
Re: kql query for distinct values If that is not an issue then after you get your host and your displayName, you can concatenate (using the strcat command) and then perform another distinct on the concatenated string. Hope this is what you are looking for.
Select Application Insights in the Azure control panel for your app service, then select Enable. Choose to create a new resource, or select an existing Application Insights resource for this application. When you click OK to create the new resource you will be prompted to Apply monitoring settings.
Using the "distinct" operator:
...
| distinct username
If you'd like a list of distinct users per month, also possible with summarize:
...
| summarize by username, bin(rTimeStamp, 30d)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With