countif()(聚合函数)countif() (aggregation function)

返回 Predicate 对其的计算结果为 true 的行数。Returns a count of rows for which Predicate evaluates to true.

  • 只能在 summarize 内的聚合上下文中使用Can be used only in context of aggregation inside summarize

另请参阅 - count() 函数,该函数计算行数(无谓词表达式)。See also - count() function, which counts rows without predicate expression.

语法Syntax

汇总 countif(Predicate)summarize countif(Predicate)

参数Arguments

  • 谓词:用于聚合计算的表达式。Predicate: Expression that will be used for aggregation calculation.

返回Returns

返回 Predicate 对其的计算结果为 true 的行数。Returns a count of rows for which Predicate evaluates to true.

提示

使用 summarize countif(filter) 而不是 where filter | summarize count()Use summarize countif(filter) instead of where filter | summarize count()