COVAR_SAMP
Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API
Computes the sample covariance between two sets of values.
<Y>: Adouble precisionexpression.<X>: Adouble precisionexpression.
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_POPfor population covariance.
Find the sample covariance between two variables.
Calculate covariance for each group.