CORR

functionsupportedCore SQL functions

docs.snowflake.com ↗

Aggregate functionsWindow functions

Returns the correlation coefficient for non-null pairs in a group. It is computed for non-null pairs using the following formula: COVAR_POP(y, x) / (STDDEV_POP(x) * STDDEV_POP(y)) Where x is the independent variable and y is the dependent variable.

Syntax

supportedpartialnot supportednot scored

Syntax when used as an aggregate function

CORR( y , x )

Syntax when used as a window function

CORR( y , x ) OVER ( [ PARTITION BY <expr3> ] )

Usage notes

See also