Counts the number of values within a column, partitioned by the unique values of a separate column
COUNTBY( column, partition column)
column
partition column
Counts the number of values within a column when grouped by unique values within a partition column.
COUNTBY() is a window function, which performs COUNT() except partitioned by the unique values of a separate column.
Column to count
Column containing unique values.
Outputs a count of values when grouped by partition column.
In this example, we want to count the number of non-null cells in {Adult Population}, partitioned by {Region}.
{Adult Population}
{Region}
Last updated 2 years ago
Was this helpful?