【问题标题】:KQL Top-Nested with Count of Matching Rows具有匹配行数的 KQL 顶部嵌套
【发布时间】:2021-10-15 02:17:03
【问题描述】:

我有一个包含源数据和位置数据的数据集。我正在尝试按来源获取最高位置,以及该路径的总点击量。

我尝试过使用汇总,但我只想要每个目的地的前 3 个来源。

TransportData
| summarize TotalVisits=count() by Destination, Source

我也尝试过使用顶部嵌套,但这让我没有每条路径的总命中数。

TransportData
| top-nested 50 of Destination by count(), top-nested 3 of Source by count()

【问题讨论】:

  • 第二个查询到底缺少什么?

标签: azure-data-explorer kql


【解决方案1】:

这可以通过使用partition 来完成。请注意,分区上限为 64 个项目,因此不适用于所有数据集。

TransportData
| partition by Destination
(
    top 3 by Source
)
| summarize TotalTrips=count()*SampleRate by Destination, Source

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-01-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-27
    • 2022-01-07
    • 1970-01-01
    相关资源
    最近更新 更多