VAR_POP() GROUP BY ...
All functions > GROUP BY > VAR_POP() GROUP BY ...
Returns the population variance of the values in the group.
Syntax
VAR_POP(expr) [ FILTER (WHERE condition) ] [ GROUP BY feature [, feature ...] ]
Notes
- Computes the population variance (divides by N)
- NULL values are excluded from the calculation
- Returns NULL if all values are NULL or group is empty
Examples
FeatureQL
SELECT
f1 := ZIP(ARRAY[1, 2, 3, 4] AS value).TRANSFORM(SELECT VAR_POP(value)).UNWRAP_ONE() -- Population variance
;Result
| f1 VARCHAR |
|---|
| 1.25 |