VARIANCE/VAR_SAMP

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Computes the sample variance of input values.

  • <expression>: An expression of any numerical type.
  • NUMERIC(38,6) for integer-type or numeric arguments.
  • double precision for floating-point arguments.

Returns NULL if the computation is meaningless.

  • Uses N-1 in the denominator (Bessel's correction).
  • Variance is the square of the standard deviation.
  • Use VAR_POP for population variance.
  • Cast the input to double precision to get a double precision result.

Find the variance of prices.

Calculate variance for each category.