Group by

The Group by step allows you to group your data by one or more columns and perform calculations on other columns. This step is useful for summarizing data and creating reports.

Step parameters

  1. Group rows by column(array)*: Select one or more columns that will be used to constitute unique groups. For example, you might group by "product" or "category".

  2. And aggregate... array(aggregation)*: Define one or more aggregations to perform on your grouped data. For each aggregation, you need to specify:

    • Columns: column(array)*: the columns to be aggregated (you can apply the same aggregation function to several columns at once)

    • Function (string)*: the aggregation function to be applied (sum, avg, count, min, or max)

  3. Keep Original Granularity (boolean): whether to keep the original granularity, in that case computed aggregations will be added in new columns. If unchecked, the output will only contain the grouped and aggregated data

Example

Input

Aggregate - group by input

Configuration

{
    "on": []
    "aggregations": [
        {
            "columns": [],
            "aggfunction": ""
        },
        {
            "columns": [],
            "aggfunction": ""
        }
    ]
    "keep_original_granularity": false 
}

Output

aggregate - group by output

If an aggregation function is applied once in a column, the output column will replace the aggregated column with the same name.

If it's applied twice or more on the same column, the aggregated columns will be named column_name-aggfunction

For example, if you compute an aggregation on a sales column for sum and average, you will have a column named sales-sum and another one titled sales-avg

Last updated

Was this helpful?