Reputation: 1204
I'd like to query the input value for the bin()
function prior to the execution, in which the three dots (...) represent a integer variable:
let bin_size =
T
| project X, Y
| summarize y_bin_size=(max(Y) - min(Y)) / ..., x_bin_size=(max(X) - min(X)) / ...;
let result =
T
| project X, Y
| summarize Count=count() by bin(X, bin_size.x_bin_size), bin(Y, bin_size.y_bin_size);
result
In ADX the bin_size is shown by hovering over the variable, as shown in the image:
Therefore, I suppose, I could access the variables y_bin_size
and x_bin_size
for my final query.
How can I access the inner results of the first let query? Can I combine this in one query?
Thanks a lot.
Upvotes: 1
Views: 786
Reputation: 25895
you could try something like this:
dynamic
.x
and y
) from the bag in #1 in the other part of your query.let bin_sizes = toscalar(
T
| summarize bag_pack("y", (max(Y) - min(Y)) / 5,
"x", (max(X) - min(X)) / 6)
)
;
let result =
T
| summarize Count=count() by
bin(X, todouble(bin_sizes.x)),
bin(Y, todouble(bin_sizes.y))
;
result
``
Upvotes: 1