varianceif() (aggregation function)
Calculates the variance of expr in records for which predicate evaluates to true
.
Null values are ignored and don't factor into the calculation.
Note
This function is used in conjunction with the summarize operator.
Syntax
varianceif(
expr,
predicate)
Learn more about syntax conventions.
Parameters
Name | Type | Required | Description |
---|---|---|---|
expr | string |
✔️ | The expression to use for the variance calculation. |
predicate | string |
✔️ | If predicate evaluates to true , the expr calculated value will be added to the variance. |
Returns
Returns the variance value of expr in records for which predicate evaluates to true
.
Example
range x from 1 to 100 step 1
| summarize varianceif(x, x%2 == 0)
Output
varianceif_x |
---|
850 |
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for