StdevpIf

StdevpIf — Static aggregate function for population standard deviation with conditions

SYNOPSIS

StdevpIf (pred1 ? expr1 ; pred2 ? expr2 ; ... ; default-expr)

DESCRIPTION

The function name is case-sensitive and contains upper-case ‘S’ and ‘I’. This function exists for static (table-based) aggregation only.

Computes a value for each record from the base table and returns the population standard deviation subject to constraints.

Predicates pred1, pred2, and so forth must be of type bool. Expressions expr1, expr2, and so forth must each be a StreamBase expression of type double, int, long, or timestamp. If the expressions are of numeric types, the expressions and the returned value can be of different types; StreamBase CEP type coercion rules apply, and each expression must be of a type that can be promoted to the type of the returned value; see Data Type Coercion. Otherwise, all expressions must be of the same type, and the returned value is of that type. The values to compute are determined by evaluation of one or more predicates. For each record from the base table, the predicates are evaluated in left-to-right order. If a predicate evaluates to true, then the computed value for that record is the value of the corresponding expression, and no further predicates are evaluated. If no predicate evaluates to true, then the computed value for that record is the value of the default expression.