User Tools

Site Tools


transformations:aggregate

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
transformations:aggregate [2015/04/10 14:04] elenaptransformations:aggregate [2021/04/02 01:47] craigt
Line 1: Line 1:
-===== Aggregate =====+{{ transformations:AggregateAction.png}} 
 +====== AGGREGATE ====== 
 +Category: Transform / Basic\\
  
-This transformation calculates the aggregates for selected columns grouped by another set of columns.+\\  
 +=====Description===== 
 +This action calculates the aggregates for selected columnsgrouped by another set of columns.
  
 Available aggregations: Available aggregations:
Line 10: Line 14:
   * Min   * Min
   * Max   * Max
 +  * Any
 +  * Concatenate
 +
 +\\ 
 +=====Action settings=====
 +^Setting^Description^
 +|Calculate|Select the column in which the values will be aggregated.|
 +|Aggregation method|Select the aggregation method to be used on the values in the chosen column.|
 +|Group by|Select the column(s) in which the grouping of values will drive the aggregation.|
 +You can aggregate more columns by the selected //Group by// columns by using the //Aggregate by more columns// option.
 +
 +The output of this action is a dataset containing the "Group by" column, plus an additional column for each aggregation chosen.\\
 +
 +\\ 
 +=====Examples=====
 +
 +**Example 1:** Find out the longest river on each continent.
 +
 +**Source table:** The longest rivers in the world
 +
 +^ River  ^ Length(km)  ^ Continent  ^
 +| Nile  |  6650|Africa  |
 +| Amazon  |  6400|South America  |
 +| Yangtze  |  6300|Asia  |
 +| Mississippi  |  6275|North America  |
 +| Yenisei  |  5539|Asia  |
 +| Yellow River  |  5464|Asia  |
 +| Ob  |  5410|Asia  |
 +| Paraná  |  4880|South America  |
 +
 +**Action parameters:**
 +
 +>Calculate: Length(km), Aggregation: Max
 +>Group by: Continent
 +
 +**Output table:**
 +
 +^Continent  ^Max of Length(km)  ^
 +|Africa  |  6650|
 +|Asia  |  6300|
 +|North America  |  6275|
 +|South America  |  6400|
 +
 +\\ 
 +\\ 
 +**Example 2:** Find out the longest river, and the number of rivers, on each continent.
 +
 +**Source table:** Same source table as Example 1.
 +
 +**Action parameters:**
 +
 +>Calculate: Length(km), Aggregation: Max
 +>Calculate: River, Aggregation: Count
 +>Group by: Continent
 +
 +**Output table:**
 +
 +^Continent^Max of Length(km)^Count of River^
 +|Africa  |  6650|  1|
 +|Asia  |  6300|  3|
 +|North America  |  6275|  1|
 +|South America  |  6400|  2|
 +
 +
 +\\ 
 +=====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:addcolumn|Calculate new column(s)]]
 +  * [[transformations:replacecolumn|Modify columns(s)]]
 +  * [[transformations:Rule|Rule]]
  
  
transformations/aggregate.txt · Last modified: 2021/09/12 11:25 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki