I'm new to Kusto and I'm trying to do grouping using summarize
where I can specify additional columns to display for the value on which I'm grouping.
This is what I'm trying to do, mentioned in standard SQL:
select UserId, LocationId, COUNT(*) as ErrorCount from SampleTable where ResultType != 'Success'
group by UserId
order by ErrorCount desc
I'm grouping by UserId
, but then I'm displaying the LocationId
for that UserId
too in the grouping result
Converting the above to Kusto, I am writing this:
SampleTable
| where ResultType != "Success"
| summarize ErrorCount=count() by UserId
| project UserId, LocationId, ErrorCount
| sort by ErrorCount desc
But it doesn't work. Kusto complains that it cannot determine was LocationId
is in the 4th line. I verified using Kusto's explain
keyword that I'm writing the correct Kusto query. So what's the problem ?