User Tools

Site Tools


transformations:enumerate

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
transformations:enumerate [2021/07/19 01:44] – [Examples] craigttransformations:enumerate [2022/11/12 22:56] (current) – udpate with new Repeat after setting (v5.3.1) craigt
Line 5: Line 5:
 \\  \\ 
 =====Description===== =====Description=====
-This action adds a new column with row numbers. Rows can be enumerated for either the entire table or inside groups defined by combinations of values in particular columns. In the latter case, row numbers restart from 1 inside each group.\\+This action adds a new column with row numbers.\\
  
-\\ +Rows can be enumerated: 
 +  *for the entire table 
 +  *inside groups defined by combinations of values in particular columns (row numbers restart from 1 inside each group) 
 +  *to a specified value (once this value is reached, enumeration restarts at 1) 
 +\\
 =====Use cases===== =====Use cases=====
   *Create unique row IDs for datasets that do not already possess a unique key field.   *Create unique row IDs for datasets that do not already possess a unique key field.
-  *To define an original record order to re-sort records by downstream.+  *To define an original record order with which to re-sort records downstream
 +  *Prepare datasets for pivoting by setting a defined number of rows and row groupings (repetitions).
  
 \\  \\ 
Line 16: Line 21:
 ^Setting^Description^ ^Setting^Description^
 |Enumerate in groups|Select this option to restart row numbering at each unique value in the selected column(s). | |Enumerate in groups|Select this option to restart row numbering at each unique value in the selected column(s). |
 +|Repeat after<sup>*</sup>|Enter or set a maximum value after which the count resets to 1.  Check the //Add column with repetition count// to\\ add a column (named "Repetition") that displays the count of the repetition.|
 |Column list|This list appears when the //Enumerate in groups// is selected.  Select which columns are taken into account to\\ form unique values when numbering columns.  Column numbering will restart at 1 for each unique value or value\\ combination across all selected columns.| |Column list|This list appears when the //Enumerate in groups// is selected.  Select which columns are taken into account to\\ form unique values when numbering columns.  Column numbering will restart at 1 for each unique value or value\\ combination across all selected columns.|
 +<sup>*</sup> Setting can be specified using a [[:parameters|parameter]].\\
  
 \\  \\ 
Line 53: Line 60:
 |  1|QC  |Montreal  |  2000|  270| |  1|QC  |Montreal  |  2000|  270|
 |  2|QC  |Quebec City  |  2000|  270| |  2|QC  |Quebec City  |  2000|  270|
 +\\ 
 +After transformation (Repeat after "2").
 +^RowNo  ^Province  ^City  ^Amount  ^Total Tax  ^
 +|  1|ON  |Toronto  | 1000|  125|
 +|  2|ON  |Ottawa  | 1000|  125|
 +|  1|ON  |Brampton  |  2000|  250|
 +|  2|QC  |Montreal  |  2000|  270|
 +|  1|QC  |Quebec City  |  2000|  270|
 +\\ 
 +After transformation (Repeat after "2", Add column with repetition count).
 +^RowNo  ^Repetition ^Province  ^City  ^Amount  ^Total Tax  ^
 +|  1|  1|ON  |Toronto  |  1000|  125|
 +|  2|  1|ON  |Ottawa  | 1000|  125|
 +|  1|  2|ON  |Brampton  |  2000|  250|
 +|  2|  2|QC  |Montreal  |  2000|  270|
 +|  1|  3|QC  |Quebec City  |  2000|  270|
  
 \\  \\ 
Line 66: Line 89:
   *[[transformations:enumerategroups|Enumerate groups]]   *[[transformations:enumerategroups|Enumerate groups]]
   *[[transformations:sequence|Sequence]]   *[[transformations:sequence|Sequence]]
- 
transformations/enumerate.txt · Last modified: 2022/11/12 22:56 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki