transformations:subtotal
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| transformations:subtotal [2018/07/22 16:00] – created dmitry | transformations:subtotal [2025/01/29 07:54] (current) – [Example #1] yurii | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Total / subtotals | + | {{ transformations: |
| + | ====== TOTAL/SUBTOTALS | ||
| + | Category: Transform / Advanced\\ | ||
| - | This action appends to a dataset a new column that contains an aggregated | + | \\ |
| + | =====Description===== | ||
| + | This action appends to a dataset a new column that contains an aggregated | ||
| - | **Example 1** | + | \\ |
| + | =====Use cases===== | ||
| + | Create a " | ||
| - | Source dataset: | ||
| - | ^ Region ^ Sales ^ | ||
| - | | North | 100 | | ||
| - | | East | ||
| - | | North | 150 | | ||
| - | | East | ||
| - | Objective: add a column | + | \\ |
| + | =====Action settings===== | ||
| + | ^Setting^Description^ | ||
| + | |New column|Enter | ||
| + | |Target column|Select the numeric column used to generate the aggregate values.| | ||
| + | |Mode|Select the aggregation mode. Options: | ||
| + | |Groups|Select whether to derive the total/ | ||
| + | \\ | ||
| + | =====Remarks===== | ||
| + | The new column will appear as the rightmost | ||
| - | Resulting dataset: | + | The grouping aspect of the //Subtotal inside groups// option is case-sensitive. |
| - | ^ Region ^ Sales ^ Total Sales ^ | + | |
| - | | North | 100 | 575 | | + | |
| - | | East | + | |
| - | | North | 150 | 575 | | + | |
| - | | East | + | |
| - | **Example 2** | + | \\ |
| + | =====Examples===== | ||
| - | Source dataset: | + | ====Example #1==== |
| + | > | ||
| + | |||
| + | ===Before (source table)=== | ||
| ^ Region ^ Sales ^ | ^ Region ^ Sales ^ | ||
| | North | 100 | | | North | 100 | | ||
| Line 30: | Line 38: | ||
| | East | | East | ||
| - | Objective: add a column | + | ===After (result table)=== |
| + | ^ Region ^ Sales ^ Total Sales ^ | ||
| + | | North | 100 | | ||
| + | | East | ||
| + | | North | 150 | | ||
| + | | East | ||
| + | |||
| + | ===Action parameters=== | ||
| + | > New column: Total Sales | ||
| + | > Target column: Sales | ||
| + | > Mode: Sum | ||
| + | > Groups: Column region | ||
| + | |||
| + | \\ | ||
| + | ====Example #2==== | ||
| + | > | ||
| + | |||
| + | ===Before (source table)=== | ||
| + | ^Game ID ^Team ^Goals Scored ^ | ||
| + | |G01 |Maple Leafs | 4| | ||
| + | |G01 |Canucks | ||
| + | |G02 |Maple Leafs | 2| | ||
| + | |G02 |Canadiens | ||
| + | |G03 |Oilers | ||
| + | |G03 |Flames | ||
| + | |G04 |Oilers | ||
| + | |G04 |Canucks | ||
| + | |G05 |Canadiens | ||
| + | |G05 |Flames | ||
| + | |||
| + | |||
| + | ===After (result table)=== | ||
| + | ^Game ID ^Team ^Goals Scored ^Average Goals ^ | ||
| + | |G01 |Maple Leafs | 4| **3**| | ||
| + | |G01 |Canucks | ||
| + | |G02 |Maple Leafs | 2| **3**| | ||
| + | |G02 |Canadiens | ||
| + | |G03 |Oilers | ||
| + | |G03 |Flames | ||
| + | |G04 |Oilers | ||
| + | |G04 |Canucks | ||
| + | |G05 |Canadiens | ||
| + | |G05 |Flames | ||
| - | Resulting dataset: | + | ===Action parameters=== |
| - | ^ Region ^ Sales ^ Total By Region ^ | + | > New column: Average Goals |
| - | | North | 100 | 250 | | + | > Target column: Goals Scored |
| - | | East | + | > Mode: Average |
| - | | North | 150 | 250 | | + | > Groups: Subtotal inside groups (Team) |
| - | | East | + | |
| - | **See also** | + | \\ |
| + | =====Community examples===== | ||
| + | | ||
| + | | ||
| + | | ||
| + | \\ | ||
| + | =====See also===== | ||
| * [[transformations: | * [[transformations: | ||
| + | * [[transformations: | ||
transformations/subtotal.1532289654.txt.gz · Last modified: by dmitry