Reputation: 3746
I have the following kusto query:
customEvents
| where name == "Tracker"
| project Id = tostring(customDimensions["Id"]),
Rank = tostring(customDimensions["Rank"])
which gives the following result:
I need to calculate the total number of rows / total number of rows with Rank >= 1 (in this case, total number of rows = 2, total number of rows with Rank >= 1 is 1 so 2/1 = 2) in kusto query. How do I add this in the above kusto query?
Upvotes: 1
Views: 254
Reputation: 25995
you can use the countif()
aggregation function.
for example:
customEvents
| where name == "Tracker"
| project Rank = tolong(customDimensions["Rank"])
| summarize result = count() / countif(Rank >= 1)
Upvotes: 1