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

计算其谓词的计算结果为 true 的组内 Expr 的stdevCalculates the stdev of Expr across the group for which Predicate evaluates to true.

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

语法Syntax

summarize stdevif(Expr, Predicate)summarize stdevif(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 added to the standard deviation.

返回Returns

其谓词计算结果为 true 的组内 Expr 的标准偏差值 。The standard deviation value of Expr across the group where Predicate evaluates to true.

示例Examples

range x from 1 to 100 step 1
| summarize stdevif(x, x%2 == 0)

stdevif_xstdevif_x
29.154759474226529.1547594742265