REGR_AVGY

functionsupportedCore SQL functions

docs.snowflake.com ↗

Aggregate functionsWindow functions

Returns the average of the dependent variable for non-null pairs in a group, where x is the independent variable and y is the dependent variable.

Syntax

supportedpartialnot supportednot scored

Aggregate function

REGR_AVGY(y, x)

Window function

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

Parameters

NameRequiredDescription
yrequiredThe dependent variable. This must be an expression that can be evaluated to a numeric type.
xrequiredThe independent variable. This must be an expression that can be evaluated to a numeric type.
expr3requiredThis is the optional expression used to group rows into partitions.

Returns

If any of the input expressions is of type DECFLOAT, the returned type is DECFLOAT. Otherwise, the returned type is FLOAT.

Usage notes