maxif()(聚合函数)maxif() (aggregation function)
返回其谓词的计算结果为 true
的组中的最大值。Returns the maximum value across the group for which Predicate evaluates to true
.
另请参阅 max() 函数,该函数在不使用谓词表达式的情况下返回组中的最大值。See also - max() function, which returns the maximum value across the group without predicate expression.
语法Syntax
summarize
maxif(
Expr,
Predicate)
summarize
maxif(
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 maximum.
返回Returns
其谓词计算结果为 true
的组中 Expr 的最大值。The maximum value of Expr across the group for which Predicate evaluates to true
.
示例Examples
range x from 1 to 100 step 1
| summarize maxif(x, x < 50)
maxif_xmaxif_x |
---|
4949 |