VAR_POP

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

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

Syntax

var_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.

SELECT var_pop(score) AS score_variance
FROM test_results;

Population Variance by Group

Calculate for each group.

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

Related Documentation