Reputation: 615
I'm new to Kusto query. I've to add two variable values using Kusto query. How to do that.
let c1 = tablename | count;
let c2 = tablename1 | count;
print c1+c2
the above query is not working
Upvotes: 1
Views: 989
Reputation: 44941
Your query fails with the following error message:
'project' operator: Failed to resolve scalar expression named 'c1'
This happens since c1 (as well as c2) is a tabular expression and not a scalar.
toscalar() can be used to do the required conversion.
let tablename = StormEvents;
let tablename1 = ConferenceSessions;
let c1 = toscalar(tablename | count);
let c2 = toscalar(tablename1 | count);
print c1+c2
print_0 |
---|
59116 |
Upvotes: 2