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/04/05 10:13] – [See also] dmitry | transformations: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 | + | *To define an original record order with which to re-sort records downstream. |
+ | | ||
\\ | \\ | ||
Line 17: | 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 | ||
Line 30: | Line 36: | ||
|QC |Quebec City | 2000| 270| | |QC |Quebec City | 2000| 270| | ||
+ | \\ | ||
After transformation (enumeration for entire table). | After transformation (enumeration for entire table). | ||
^RowNo | ^RowNo | ||
Line 38: | Line 44: | ||
| 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 | ^RowNo | ||
Line 46: | Line 52: | ||
| 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 | ^RowNo | ||
Line 54: | Line 60: | ||
| 1|QC |Montreal | | 1|QC |Montreal | ||
| 2|QC |Quebec City | 2000| 270| | | 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| 2|ON |Brampton | ||
+ | | 2| 2|QC |Montreal | ||
+ | | 1| 3|QC |Quebec City | 2000| 270| | ||
+ | |||
+ | \\ | ||
+ | ====Community examples==== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
\\ | \\ | ||
Line 59: | Line 89: | ||
*[[transformations: | *[[transformations: | ||
*[[transformations: | *[[transformations: | ||
- |
transformations/enumerate.txt · Last modified: 2022/11/12 22:56 by craigt