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
Next revision
Previous revision
Next revisionBoth sides next revision
transformations:enumerate [2021/03/21 14:26] craigttransformations:enumerate [2021/03/28 23:39] craigt
Line 1: Line 1:
 {{ transformations:EnumerateRowsAction.png}} {{ transformations:EnumerateRowsAction.png}}
 ====== 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 tableor 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 16: Line 23:
  
 **Source table** **Source table**
- Province  City  ^  Amount  Total Tax  ^ +^Province  ^City  ^Amount  ^Total Tax  ^ 
- ON  |  Toronto  |  1000|  125| +|ON  |Toronto  |  1000|  125| 
- ON  |  Ottawa  |  1000|  125| +|ON  |Ottawa  |  1000|  125| 
- ON  |  Brampton  |  2000|  250| +|ON  |Brampton  |  2000|  250| 
- QC  |  Montreal  |  2000|  270| +|QC  |Montreal  |  2000|  270| 
- QC  |  Quebec City  |  2000|  270|+|QC  |Quebec City  |  2000|  270|
  
  
 After transformation (enumeration for entire table). After transformation (enumeration for entire table).
- RowNo  ^  Province  City  ^  Amount  Total Tax  ^ +^RowNo  ^Province  ^City  ^Amount  ^Total Tax  ^ 
-|  1|  ON  |  Toronto  | 1000|  125| +|  1|ON  |Toronto  | 1000|  125| 
-|  2|  ON  |  Ottawa  | 1000|  125| +|  2|ON  |Ottawa  | 1000|  125| 
-|  3|  ON  |  Brampton  |  2000|  250| +|  3|ON  |Brampton  |  2000|  250| 
-|  4|  QC  |  Montreal  |  2000|  270| +|  4|QC  |Montreal  |  2000|  270| 
-|  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  City  ^  Amount  Total Tax  ^ +^RowNo  ^Province  ^City  ^Amount  ^Total Tax  ^ 
-|  1|  ON  |  Toronto  | 1000|  125| +|  1|ON  |Toronto  | 1000|  125| 
-|  2|  ON  |  Ottawa  | 1000|  125| +|  2|ON  |Ottawa  | 1000|  125| 
-|  3|  ON  |  Brampton  |  2000|  250| +|  3|ON  |Brampton  |  2000|  250| 
-|  1|  QC  |  Montreal  |  2000|  270| +|  1|QC  |Montreal  |  2000|  270| 
-|  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  City  ^  Amount  Total Tax  ^ +^RowNo  ^Province  ^City  ^Amount  ^Total Tax  ^ 
-|  1|  ON  |  Toronto  | 1000|  125| +|  1|ON  |Toronto  | 1000|  125| 
-|  2|  ON  |  Ottawa  | 1000|  125| +|  2|ON  |Ottawa  | 1000|  125| 
-|  1|  ON  |  Brampton  |  2000|  250| +|  1|ON  |Brampton  |  2000|  250| 
-|  1|  QC  |  Montreal  |  2000|  270| +|  1|QC  |Montreal  |  2000|  270| 
-|  2|  QC  |  Quebec City  |  2000|  270|+|  2|QC  |Quebec City  |  2000|  270|
  
 \\  \\ 
transformations/enumerate.txt · Last modified: 2022/11/12 22:56 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki