User Tools

Site Tools


transformations:aggregate

AGGREGATE

Category: Transform / Basic


Description

This action calculates the aggregates for selected columns, grouped by another set of columns.


Use cases

Available aggregations:

  • Sum: generates the total of values.
  • Count: generates the count of values.
  • Count only distinct values: generates the count of unique values.
  • Average: generates the average of values.
  • Min: generates the minimum of all values.
  • Max: generates the maximum of all values.
  • Any: returns the first value in the selected column.
  • Concatenate: combines all values into a single string, delimited by the selected character.


Action settings

SettingDescription
CalculateSelect the column in which the values will be aggregated.
Aggregation methodSelect the aggregation method to be used on the values in the chosen column.
Group bySelect the column(s) in which the grouping of values will drive the aggregation.

More than one aggregated column can be created by clicking the Aggregate by more columns option and selecting the additional column and aggregation to apply.

The output of this action is a dataset containing the "Group by" column, plus an additional column for each aggregation chosen.

Concatenate settings

SettingDescription
SeparatorSelect the character (delimiter) that will appear between the concatenated values. Options: Comma, Semicolon, Tab, Pipe, Tilde, Space, Line break, or No separator.
DistinctWhen checked, only unique values in the aggregated column will be included in the concatenation.


Examples

Example #1

Determine the longest river on each continent.

Before (source table)

River Length(km) Continent
Amazon 6400South America
Yangtze 6300Asia
Yenisei 5539Asia
Mississippi 6275North America
Ob 5410Asia
Paraná 4880South America

After (result table)

Continent Length(km)
Asia 6300
North America 6275
South America 6400

Action parameters:

Calculate: Length(km), Aggregation: Max
Group by: Continent


Community examples


Shortcuts

Fast ways to create the action:

  • Right-click on a column heading, and select "Aggregate", then select the aggregation method from the submenu.
  • Click the drop-down arrow in a column heading and select "Aggregate", then select the aggregation method.


See also

transformations/aggregate.txt · Last modified: 2025/01/10 11:12 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki