User Tools

Site Tools


transformations:enumerategroups

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
Last revisionBoth sides next revision
transformations:enumerategroups [2021/04/05 10:13] dmitrytransformations:enumerategroups [2021/07/15 11:43] craigt
Line 1: Line 1:
-===== Enumerate groups =====+{{ transformations:EnumerateGroupsAction.png}} 
 +====== ENUMERATE GROUPS ====== 
 +Category: Transform / Advanced\\
  
-This action adds a new column with generated group numbers. A group is defined by a column or a combination of columns. Groups are enumerated starting from 1.+\\  
 +=====Description===== 
 +This action generates group numbers in new column. \\
  
-**Example**+A "group" is defined by unique values in a column or unique combinations of values across multiple columns.\\
  
-Before:+\\  
 +=====Use cases===== 
 +The action is can be used to create group ID numbers for later reference, lookups, or merges.\\ 
 + 
 +\\  
 +=====Action settings===== 
 +^Setting^Description^ 
 +|Column|Select the column or columns to base the group numbers on.| 
 + 
 +\\  
 +=====Remarks===== 
 + Groups are enumerated starting from 1.\\ 
 + 
 +The new column containing the group numbers will be named "GroupNo" and appear as the leftmost column, by default.\\ 
 + 
 +When multiple columns are selected, the unique combinations of values across the selected columns are what constitutes the "groups"
 + 
 +\\  
 +=====Examples===== 
 +**Example 1:** Enumerate groups based on the values in the "Province" column. 
 + 
 +**Source table:**
 ^Province  ^Amount  ^Total Tax  ^ ^Province  ^Amount  ^Total Tax  ^
 |  ON  | 1000| 125| |  ON  | 1000| 125|
 |  ON  | 1500| 187.5| |  ON  | 1500| 187.5|
 |  QC  |    2000| 270| |  QC  |    2000| 270|
- +\\  
-After (groups are defined by column "Province"):+**Action parameters:** 
 +> Column "Province" is selected 
 +\\  
 +**Result:**
 ^GroupNo ^Province  ^Amount  ^Total Tax  ^ ^GroupNo ^Province  ^Amount  ^Total Tax  ^
 |  1|  ON  | 1000| 125| |  1|  ON  | 1000| 125|
 |  1|  ON  | 1500| 187.5| |  1|  ON  | 1500| 187.5|
-|  2|  QC  |     2000| 270|+|  2|  QC  |    2000| 270
 + 
 +\\ \\ \\  
 +**Example 2:** Generate group numbers from the values in the selected columns.\\ 
 + 
 +**Source table:** 
 +^FirstName  ^Middle Init ^LastName ^ 
 +|Mary |K |Jones | 
 +|Sam |A |Walker | 
 +|Mary |M |Doe | 
 +|Reggie |B |Monroe | 
 +|Sam |D |Walker | 
 +|Trisha |E |West | 
 +|Sam |A |Adams | 
 +\\  
 +**Action parameters:** 
 +> Column "FirstName" is selected 
 +\\  
 +**Results:** 
 +^GroupNo ^FirstName  ^Middle Init ^LastName ^ 
 +|1|Mary |K |Jones | 
 +|2|Sam |A |Walker | 
 +|1|Mary |M |Doe | 
 +|3|Reggie |B |Monroe | 
 +|2|Sam |D |Walker | 
 +|4|Trisha |E |West | 
 +|2|Sam |A |Adams | 
 +\\ 
 +**Action parameters:**  (Using the same source table, above.)\\ 
 +> Column "FirstName" and "LastName" are selected 
 +\\  
 +**Results:** 
 +^GroupNo ^FirstName  ^Middle Init ^LastName ^ 
 +|1|Mary |K |Jones | 
 +|2|Sam |A |Walker | 
 +|3|Mary |M |Doe | 
 +|4|Reggie |B |Monroe | 
 +|2|Sam |D |Walker | 
 +|5|Trisha |E |West | 
 +|6|Sam |A |Adams |
  
-==== See also ====+\\  
 +====Community examples==== 
 +  * [[https://community.easymorph.com/t//1652/2|Which technique for grouping many columns of data together (i.e. 50+ columns)]] ([[https://community.easymorph.com/uploads/short-url/ub3zV5WsGF4rWqJQMb7oEtPReqy.morph|Project]]; Module: //Main//; Group: //Tab 1//;\\ Table: //Enumerate groups//; Action position: //2//) 
 +  * [[https://community.easymorph.com/t//1837/4|Joining different pairs of value equivalences into “global equivalences”]] ([[https://community.easymorph.com/uploads/short-url/1TpBXIjf6r4auDHlOBejKh2rSTw.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //Make up//;\\ Action position: //2//)
  
 +\\ 
 +=====See also=====
   * [[transformations:enumerate|Enumerate rows]]   * [[transformations:enumerate|Enumerate rows]]
transformations/enumerategroups.txt · Last modified: 2021/07/19 02:26 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki