variance() (aggregation function)
Calculates the variance of Expr across the group, considering the group as a sample.
The following formula is used:
:::image type="content" source="images/variance-aggfunction/variance-sample.png" alt-text="Image showing a variance sample formula.":::
[!INCLUDE data-explorer-agg-function-summarize-note]
Syntax
variance (Expr)
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
| Expr | string | ✓ | Expression that will be used for aggregation calculation. |
Returns
Returns the variance value of Expr across the group.
Example
range x from 1 to 5 step 1
| summarize make_list(x), variance(x)
Results
| list_x | variance_x |
|---|---|
| [ 1, 2, 3, 4, 5] | 2.5 |