Skip to main content

Group and Aggregate

The Group and Aggregate task lets you summarize your data by doing one or both of the following:

  • Grouping rows with the same set of values.
  • Calculate aggregate functions.

Quickstart

Let us start with the following sample data:

ProductPriceCategory
HP Elite900.00Laptop
Lenovo Thinkpad1100.00Laptop
Sony VAIO600.00Laptop
Microsoft Lumia300.00Smartphone
HTC One400.00Smartphone
iPad700.00Tablet
Kindle Fire300.00Tablet

Let us calculate the average price in each Category. Complete the following steps:

  1. Go to Transform > Reshape, Group & Aggregate.
  2. Select the Group & Aggregate option.
  3. In the Group the following section, find the column Category and add it by clicking on the + button.
  4. In the And Aggregate By section, find the column Price. Change the dropdown before it to AVG. Click on the + button. Change the format to have two decimal places.
  5. Click APPLY.

The following table shows the final result:

CategoryAvg. of Price
Laptop866.67
Smartphone350.00
Tablet500.00

We can calculate multiple aggregations. Let us edit the task we just created. Let us add these items to the result from the Aggregate the following section.

  1. COUNT
  2. MAX of Price
  3. MIN of Price

The following table shows the final result:

CategoryAvg. of PriceCountMax of PriceMin of Price
Laptop866.6731,100600
Smartphone350.002400300
Tablet500.002700300

You can add multiple items from group the following section too. For example, say you add two different columns. Then the data will be grouped by each unique combination values in those two columns from the data.

Supported Options

The following inputs are expected by this task:

  • Group the following: Select any column you would like to group by. If multiple columns are selected, the data will be grouped by each unique combination values in those columns from the data.
  • Aggregate the following: Select any aggregations you would like to include in your summary. The aggregation will be calculated for each group. In case you have not selected any column to group by, aggregation will be calculated over the entire data.
note
  1. You can rename or change the format of the selected aggregations.
  2. You drag-and-drop to reorder the results.