Last active
November 19, 2017 08:53
-
-
Save bennybauer/77559b1f80804b9fbb4d6684ec31130a to your computer and use it in GitHub Desktop.
Azure Application Insights query to fetch weekly totals of all custom events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
customEvents | |
| where timestamp between (startofweek(ago(14d))..now()) | |
| make-series dcount(user_Id) on timestamp in range(startofweek(now()),endofweek(now()), 7d) by name | |
| mvexpand timestamp, dcount_user_Id | |
| extend Week = weekofyear(todatetime(timestamp)) | |
| project Week, timestamp, name, toint(dcount_user_Id) | |
| summarize sum(dcount_user_Id) by name, Week, tostring(timestamp) | |
| order by Week desc, sum_dcount_user_Id desc | |
| evaluate pivot(name, sum(sum_dcount_user_Id)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment