User Tools

Site Tools


transformations:replace

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:replace [2021/03/21 12:57] craigttransformations:replace [2021/07/17 23:36] – [Examples] craigt
Line 1: Line 1:
 {{ transformations:ReplaceAction.png}} {{ transformations:ReplaceAction.png}}
 ====== REPLACE ====== ====== REPLACE ======
-Category: Transform / Basic+Category: Transform / Basic\\
  
 +\\ 
 =====Description===== =====Description=====
-This action replaces particular values in a column with new values. The new values can be either text or numbers.  Multiple old values can be replaced with the same new value.+This action replaces particular values in a column with new values. The new values can be either text or numbers.  Multiple old values can be replaced with the same new value.\\ 
 + 
 +\\  
 +=====Use cases===== 
 +Replacing mistyped names and words with correct ones.
  
 +If used together with the [[transformations:sequence|Sequence]] transformation, it allows defining relatively small custom lists. Use Replace to replace 1 with one custom value, 2 with another one, etc.\\
  
 \\  \\ 
Line 18: Line 24:
  
 \\  \\ 
-=====Use cases===== +=====Remarks===== 
-Replacing mistyped names and words with correct ones. +Only //whole// values are replaced with this actionnot partial matches.\\
- +
-If used together with the [[transformations:sequence|Sequence]] transformationit allows defining relatively small custom listsUse Replace to replace 1 with one custom value, 2 with another one, etc. +
  
 \\  \\ 
 =====Examples===== =====Examples=====
  
-**Example:**  Expand the names of the "America" values (N. North, S. South).+**Example:**  Expand the names of the "America" values ("N." to "North""S." to "South").
  
 **Source table:** The longest rivers in the world **Source table:** The longest rivers in the world
  
- River  ^  Length (km)  ^  Length (miles)  Continent +^River  ^Length (km)  ^Length (miles)  ^Continent 
-| Nile  |  6650  |  4132   Africa +| Nile  |  6650|  4132|Africa 
-| Amazon  |  6400  |  3976   S. America +| Amazon  |  6400|  3976|S. America 
-| Yangtze  |  6300  |  3917   Asia  | +| Yangtze  |  6300|  3917|Asia 
-| Mississippi  |  6275  |  3902   N. America  |+| Mississippi  |  6275|  3902|N. America  |
  
  
-**Transformation parameters:**+**Action parameters:**
  
 >  Continent column. >  Continent column.
Line 47: Line 50:
 **Output table:** **Output table:**
  
- River  ^  Length (km)  ^  Length (miles)  Continent +^River  ^Length (km)  ^Length (miles)  ^Continent 
-| Nile  |  6650  |  4132   Africa +| Nile  |  6650|  4132|Africa 
-| Amazon  |  6400  |  3976   South America +| Amazon  |  6400|  3976|South America 
-| Yangtze  |  6300  |  3917   Asia  | +| Yangtze  |  6300|  3917|Asia 
-| Mississippi  |  6275  |  3902   North America  |+| Mississippi  |  6275|  3902|North America  |
  
 +\\ 
 +====Community examples====
 +  * [[https://community.easymorph.com/t//1590/4|Puzzler: derived column from two columns]] ([[https://community.easymorph.com/uploads/short-url/5OvCYyhfiaCg5XZU3nALaT5eql4.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //Table 1//; Action position: //5//)
 +  * [[https://community.easymorph.com/t//1972/2|Read Data with two line header]] ([[https://community.easymorph.com/uploads/short-url/4YFQxslIv3pmgtF2eRywf4wpcFQ.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //Read, Mark groups//; Action position: //7//)
 +  * [[https://community.easymorph.com/t//2060/2|Search, remove, and shift]] ([[https://community.easymorph.com/uploads/short-url/cCqOTak9SLKPXbityR5IAlgULJa.morph|Project]]; Module: //Main//; Group: //Regrouping//; Table: //ExtractingData.xlsx//; Action position: //6//)
  
 +\\ 
 +=====Shortcuts=====
 +Fast ways to create the action:\\
 +
 +  *Right-click on the value to replace in a dataset and select "Replace (value)...".
  
 \\  \\ 
-=====See Also===== +=====See also===== 
-  * [[transformations:sequence|Sequence]]+  * [[transformations:replacewithlookup|Replace with lookup]] 
 +  * [[transformations:lookup|Lookup]] 
 +  * [[transformations:rule|Rule]] 
  
transformations/replace.txt · Last modified: 2021/07/17 23:37 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki