【问题标题】:Kusto grouping as in UI在 UI 中进行 Kusto 分组
【发布时间】:2020-10-30 09:18:07
【问题描述】:

如何在查询中创建如下所示的分组(不使用 UI)。

【问题讨论】:

    标签: azure-data-explorer kql


    【解决方案1】:

    以下是 2 个不同的选项

    1)

    datatable(firstname:string, lastname:string)
    [
        "John", "Miller",
        "John", "Smith",
        "Mike", "Stone",
        "Harry", "Keller"
    ]
    | summarize properties = make_list(pack("firstname", firstname, "lastname", lastname)) by firstname
    
    firstname   properties
    ---------   ----------
    John        [{"firstname":"John","lastname":"Miller"},{"firstname":"John","lastname":"Smith"}]
    Mike        [{"firstname":"Mike","lastname":"Stone"}]
    Harry       [{"firstname":"Harry","lastname":"Keller"}]
    
    datatable(firstname:string, lastname:string)
    [
        "John", "Miller",
        "John", "Smith",
        "Mike", "Stone",
        "Harry", "Keller"
    ]
    | summarize properties = make_list(strcat(firstname, " ", lastname)) by firstname
    
    firstname   properties
    ---------   ----------
    John        ["John Miller","John Smith"]
    Mike        ["Mike Stone"]
    Harry       ["Harry Keller"]
    

    【讨论】:

    • 谢谢你。从您的回答中,我得出无法创建 UI 的精确副本。在 UI 表示中,我喜欢在分组后保留列 - 它们没有组合成单个“属性”列。
    猜你喜欢
    • 2021-10-15
    • 1970-01-01
    • 1970-01-01
    • 2020-08-28
    • 2020-11-16
    • 2021-04-04
    • 1970-01-01
    • 2020-10-31
    • 1970-01-01
    相关资源
    最近更新 更多