regr_slope aggregate function
Applies to: Databricks SQL Databricks Runtime
Returns the slope of the linear regression line a group where
yExpr are NOT NULL.
regr_slope( [ALL | DISTINCT] yExpr, xExpr) [FILTER ( WHERE cond ) ]
This function can also be invoked as a window function using the
yExpr: A numeric expression, the dependent variable.
xExpr: A numeric expression, the independent variable.
cond: An optional boolean expression filtering the rows used for the function.
Any nulls within the group are ignored. If a group is empty or consists only of nulls, the result is NULL.
DISTINCT is specified, the average is computed after duplicates are removed.