transformations:enumerate
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
transformations:enumerate [2021/03/21 14:26] – craigt | transformations:enumerate [2022/11/12 22:56] (current) – udpate with new Repeat after setting (v5.3.1) craigt | ||
---|---|---|---|
Line 1: | Line 1: | ||
{{ transformations: | {{ transformations: | ||
====== ENUMERATE ROWS ====== | ====== ENUMERATE ROWS ====== | ||
- | Category: Transform / Basic | + | Category: Transform / Basic\\ |
+ | \\ | ||
=====Description===== | =====Description===== | ||
- | This action adds a new column with row numbers. Rows can be enumerated for either | + | 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 | ||
+ | *to a specified value (once this value is reached, enumeration restarts at 1) | ||
+ | \\ | ||
+ | =====Use cases===== | ||
+ | *Create unique row IDs for datasets that do not already possess a unique key field. | ||
+ | *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 10: | 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< | ||
|Column list|This list appears when the //Enumerate in groups// is selected. | |Column list|This list appears when the //Enumerate in groups// is selected. | ||
+ | < | ||
\\ | \\ | ||
=====Examples===== | =====Examples===== | ||
- | **Source table** | + | **Source table:** |
- | ^ Province | + | ^Province |
- | | ON | Toronto | + | |ON |Toronto |
- | | ON | Ottawa | + | |ON |Ottawa |
- | | ON | Brampton | + | |ON |Brampton |
- | | QC | Montreal | + | |QC |Montreal |
- | | QC | Quebec City | 2000| 270| | + | |QC |Quebec City | 2000| 270| |
+ | \\ | ||
After transformation (enumeration for entire table). | After transformation (enumeration for entire table). | ||
- | ^ RowNo ^ Province | + | ^RowNo |
- | | 1| ON | Toronto | + | | 1|ON |Toronto |
- | | 2| ON | Ottawa | + | | 2|ON |Ottawa |
- | | 3| ON | Brampton | + | | 3|ON |Brampton |
- | | 4| QC | Montreal | + | | 4|QC |Montreal |
- | | 5| QC | Quebec City | 2000| 270| | + | | 5|QC |Quebec City | 2000| 270| |
+ | \\ | ||
After transformation (enumeration for each Province). | After transformation (enumeration for each Province). | ||
- | ^ RowNo ^ Province | + | ^RowNo |
- | | 1| ON | Toronto | + | | 1|ON |Toronto |
- | | 2| ON | Ottawa | + | | 2|ON |Ottawa |
- | | 3| ON | Brampton | + | | 3|ON |Brampton |
- | | 1| QC | Montreal | + | | 1|QC |Montreal |
- | | 2| QC | Quebec City | 2000| 270| | + | | 2|QC |Quebec City | 2000| 270| |
+ | \\ | ||
After transformation (enumeration for each Province-Amount pairing). | After transformation (enumeration for each Province-Amount pairing). | ||
- | ^ RowNo ^ Province | + | ^RowNo |
- | | 1| ON | Toronto | + | | 1|ON |Toronto |
- | | 2| ON | Ottawa | + | | 2|ON |Ottawa |
- | | 1| ON | Brampton | + | | 1|ON |Brampton |
- | | | + | | 1|QC |Montreal |
- | | | + | | 2|QC |Quebec City | 2000| 270| |
+ | \\ | ||
+ | After transformation (Repeat after " | ||
+ | ^RowNo | ||
+ | | 1|ON |Toronto | ||
+ | | 2|ON |Ottawa | ||
+ | | 1|ON |Brampton | ||
+ | | 2|QC |Montreal | ||
+ | | 1|QC |Quebec City | 2000| 270| | ||
+ | \\ | ||
+ | After transformation (Repeat after " | ||
+ | ^RowNo | ||
+ | | 1| 1|ON |Toronto | ||
+ | | 2| 1|ON |Ottawa | ||
+ | | 1| | ||
+ | | | ||
+ | | | ||
+ | |||
+ | \\ | ||
+ | ====Community examples==== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
\\ | \\ | ||
=====See also===== | =====See also===== | ||
*[[transformations: | *[[transformations: | ||
+ | *[[transformations: |
transformations/enumerate.txt · Last modified: 2022/11/12 22:56 by craigt