1
votes

I'm trying to summarize the count of exceptions, the count of requests, and then the ratio of exceptions / requests. I can't determine how to calculate the two summaries and then project the ratio and return it. I'm trying something along the following without success:

let exceptionCount = exceptions
| where type == "ShiftDigital.InventoryServices.API.GetVehicleException" and outerMessage !contains("Invalid zip code")
| count as ExceptionCount;

requests
| count as RequestCount
| extend RequestCount / exceptionCount

Can someone please advise on the correct way to structure this query?

1
Hi @James, please accept the answer below if it helps (see this to know how and why to do it). Thanks! (And if you're still missing info, please add a comment describing what's missing).Slavik N

1 Answers

1
votes

You're missing toscalar()

let exceptionCount = toscalar(exceptions
| where type == "ShiftDigital.InventoryServices.API.GetVehicleException" and outerMessage !contains("Invalid zip code")
| count);
let requestsCount = toscalar(requests
| count);
print requestCount * 1.0 / exceptionCount