Application Insights 按聚合排序

Application Insights order by aggregate

我有以下查询:

customEvents
| summarize count(datepart("Second", timestamp) ) 
    by toint(customMeasurements.Latency)

这是计算一分钟后的秒数并按整数分组 Latency

如何向其中添加 order by 运算符以按这些列排序?

为此,您需要为列设置别名。

通过在值前加上 column_alias= 前缀来执行别名列。

customEvents
| summarize Count=count(datepart("Second", timestamp) ) 
    by Latency=toint(customMeasurements.Latency)

然后我们可以通过别名引用这些列:

customEvents
| summarize Count=count(datepart("Second", timestamp) ) 
    by Latency=toint(customMeasurements.Latency)
| order by Latency asc nulls last