VAR_POP

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Computes the population variance of input values (square of the population standard deviation).

Syntax 

1var_pop(<expression>)

Arguments 

Required 

  • <expression>: An expression of any numerical type.

Returns 

  • NUMERIC(38,6) for integer-type or numeric arguments.
  • double precision for floating-point arguments.

Returns NULL if the computation is meaningless.

Considerations 

  • Uses N in the denominator (no Bessel’s correction).
  • Population variance is the square of STDDEV_POP.
  • Use VAR_SAMP or VARIANCE for sample variance.
  • Cast the input to double precision to get a double precision result.

Examples 

Calculate Population Variance 

Find the population variance of scores.

1SELECT var_pop(score) AS score_variance
2FROM test_results;

Population Variance by Group 

Calculate for each group.

1SELECT class_id, var_pop(grade) AS grade_variance
2FROM student_grades
3GROUP BY class_id;

Related Documentation