transformations:enumerate
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
transformations:enumerate [2021/03/21 14:26] – craigt | transformations:enumerate [2021/07/19 01:44] – [Examples] 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 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 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.\\ |
+ | |||
+ | \\ | ||
+ | =====Use cases===== | ||
+ | *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. | ||
\\ | \\ | ||
Line 15: | Line 21: | ||
=====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 | + | | 1|QC |Montreal |
- | | 2| QC | Quebec City | 2000| 270| | + | | 2|QC |Quebec City | 2000| 270| |
+ | |||
+ | \\ | ||
+ | ====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