Forum Discussion
Nikhil_Babu_Battula
Oct 09, 2022Copper Contributor
Query to compare values from last week to values generated today
I want to compare the total `TriggersStarted` (from MetricName column) from last week to `TriggersStarted` (from MetricName column) today For that I am using the following query AzureMetri...
Clive_Watson
Oct 10, 2022Bronze Contributor
How about?
AzureMetrics
| where TimeGenerated between ( ago(7d) .. endofday(ago(1d)) )
| where MetricName == "TriggersStarted"
| summarize LastWeek=count() by MetricName
| join
(
AzureMetrics
| where TimeGenerated between (startofday(ago(0d)) .. now() )
| where MetricName == "TriggersStarted"
| summarize TodaysoFar=count()by MetricName
) on MetricName
| project-away MetricName1- Nikhil_Babu_BattulaOct 11, 2022Copper Contributor
Thanks for the help Clive_Watson i am trying to calculate number of triggers triggerstarted by hour in last week (7*24 = 168 hours). And out of those 168 hour bucket triggers .i want to find the hour which has min number of triggersStarted. And compare that to this week current hour triggers for that i made small changes to your query. if u dont mind could u pls guide which functions to use? to get that query? for that if i tried using bin it just rounding off to the offset value, pivot, range functions but didnt got expected results