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

返回其谓词的计算结果为 true 的组中的最小值。Returns the minimum value across the group for which Predicate evaluates to true.

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

另请参阅 - min() 函数,该函数在不使用谓词表达式的情况下返回组中的最小值。See also - min() function, which returns the minimum value across the group without predicate expression.

语法Syntax

summarize minif(Expr,Predicate)summarize minif(Expr,Predicate)

参数Arguments

  • Expr:用于聚合计算的表达式。Expr: Expression that will be used for aggregation calculation.
  • Predicate:在谓词为 true 的情况下,将检查 Expr 的计算值是否为最小值。Predicate: predicate that if true, the Expr calculated value will be checked for minimum.

返回Returns

其谓词计算结果为 true 的组中 Expr 的最小值。The minimum value of Expr across the group for which Predicate evaluates to true.

示例Examples

range x from 1 to 100 step 1
| summarize minif(x, x > 50)
minif_xminif_x
5151