Description:
Calculate the overall variance for the aggregation field value.
var(x)
Note:
The function calculates the overall variance for the aggregation field value x. The function can only work as an aggregate function to be used in groups() function.
Option:
@s |
Calculate the sample variance of aggregation field value x by dividing it by n-1 |
Parameter:
x |
Aggregation field name, whose data type must be numeric |
Return value:
Numeric value
|
A |
|
1 |
=demo.query("select NAME,EVENT,SCORE from GYMSCORE") |
Return a sequence:
|
2 |
=A1.groups(EVENT;var(SCORE):SCORE_var) |
Group A1’s sequence by EVENT field and calculate SCORE value’s overall variance in each group:
|
3 |
=A1.groups(EVENT;var@s(SCORE):SCORE_var) |
Use @s option to calculate the sample variance of SCORE value in each group:
|