【问题标题】:Kusto (KQL): Count of all columns where value < 0Kusto (KQL):值 < 0 的所有列的计数
【发布时间】:2021-03-23 19:52:26
【问题描述】:

目标:计算值

Example as shown:

Table
| summarize count() by Field
| where (Col1 <0 or Col2 <0 or Col3 <0 or Col4 <0)

我得到的结果是:

A | 1
B | 1
C | 0

Kusto 新手 - 我做错了什么?

谢谢

【问题讨论】:

    标签: azure-data-explorer kql


    【解决方案1】:

    尝试颠倒过滤器和聚合的顺序,即:

    Table
    | where (Col1 <0 or Col2 <0 or Col3 <0 or Col4 <0)
    | summarize count() by Field
    

    或者使用countif()聚合函数:

    Table
    | summarize countif(Col1 <0 or Col2 <0 or Col3 <0 or Col4 <0) by Field
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多