SKEW

functionsupportedCore SQL functions

docs.snowflake.com ↗

Data metric functionsAggregate functions

Returns the sample skewness of non-NULL records. If all records inside a group are NULL, the function returns NULL. The following formula is used to compute the sample skewness: (n^2)/((n-1) * (n-2)) * (m_3/(k_2)^(1.5))where: - n denotes the number of non-null records. - m_3 denotes the sample third central moment. - k_2 denotes the symmetric unbiased estimator of the variance. Intuitively, skew describes how asymmetric the underlying distribution is.

Syntax

SKEW( <expr> )

Parameters

NameRequiredDescription
exprrequiredThis is an expression that evaluates to a numeric data type (INTEGER, FLOAT, DECIMAL, etc.).

Returns

This function returns a value of type DOUBLE.

Usage notes