COVAR_SAMP

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Computes the sample covariance between two sets of values.

  • <Y>: A double precision expression.
  • <X>: A double precision expression.

Returns a double precision value representing the sample covariance. Returns NULL if the computation is meaningless.

  • Returns NULL if there are fewer than two rows where both X and Y are non-null.
  • Sample covariance uses N-1 in the denominator (Bessel's correction).
  • Use COVAR_POP for population covariance.

Find the sample covariance between two variables.

Calculate covariance for each group.