Applies to: Databricks SQL Databricks Runtime
Returns the number of true values for the group in
count_if ( [ALL | DISTINCT] expr ) [FILTER ( WHERE cond ) ]
This function can also be invoked as a window function using the
expr: A BOOLEAN expression.
cond: An optional boolean expression filtering the rows used for aggregation.
count_if(expr) FILTER(WHERE cond) is equivalent to
count_if(expr AND cond).
DISTINCT is specified only unique rows are counted.