I have the following Kusto Query (very simplified example of what I'm actually doing):
let cnt1 = toscalar(StormEvents
| where EventType == 'Flood' and State == 'CALIFORNIA'
| count);
let cnt2 = toscalar(StormEvents
| where State == 'CALIFORNIA'
| count);
let ratio = cnt1/cnt2;
Now I want to be able to show this result. But of course, the ratio value is a scalar. So to display it, I need to have a tabular expression otherwise I get this error:
the following semantic error: SEM0002: No tabular expression statement found.
So I figured I could just put the value ratio into a datatable at the end like so:
datatable (Ratio: double) [ratio]
That doesn't work and I get more errors. But if I initialize my data with a constant like 98.6. It works fine. So I guess I can't make a table from a computed value.
Maybe I'm going about this the wrong way. I really just want to be able to show that computed ratio.