User Tools

Site Tools


transformations:match

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
transformations:match [2018/08/15 14:21] dmitrytransformations:match [2021/07/19 02:23] (current) – [Examples] craigt
Line 1: Line 1:
-===== Match =====+{{ transformations:MatchAction.png}} 
 +====== MATCH ====== 
 +Category: Transform / Advanced\\
  
-This action goes through text values of a column in one table and finds matching values in another table (lookup table). Matched lookup values then replace original values. For each value only the first match is applied, other matches are ignored.+\\  
 +=====Description===== 
 +This action goes through the text values of a column in one table and finds matching values in another table (lookup table). Matched lookup values then replace original values. In the case of multiple matches, an arbitrary match is taken (in no particular order) and other matches are ignored.
  
-**Match modes**+\\  
 +=====Use cases===== 
 +The //Fuzzy// mode of this action can be used for matching text values that may have typos.
  
-   //Contains// a lookup value is matched if the matched value contains it. For instancein this mode ''tor'' would match ''Motorola''+\\  
-   * //Starts with// - a lookup value is matched if the matched value starts with it. In this mode ''Moto'' would match ''Motorola''+=====Action settings===== 
-   * //Ends with// - a lookup value is matched if the matched value ends with it. In this mode ''rola'' would match ''Motorola''+^Setting^Description^ 
-   * //Fuzzy// - a lookup value is matched if the matched value is within the specified edit distance. The [[https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance|Damerau–Levenshtein edit distance]] measures the number of edit operations to produce one word from another. For an edit distance 1, ''Motorola'' would match ''Motrola'' or ''Monorola'', but wouldn't match ''Morotola''This matching mode can be used for matching text values that may have typos.+|Column|Select the column in the current dataset that contains the values to match in the lookup table.| 
 +|Lookup table|Select the dataset to be use for the lookup.| 
 +|Lookup column|This setting appears once the //Lookup table// has been selected.  Select the column that contains the values\\ to be matched to.| 
 +|Match mode|Options: //Contains//, //Starts with//, //Ends with//, and //Fuzzy// See the table below.| 
 +|Case sensitive match|When checked, text case must match in the lookup values.| 
 +|If not matched|Choose how unmatched values are handled.  Options: //Keep existing value//, //Make empty//, or //Default to// (and choose\\ whether this value is an expression, or text or number, and enter the expression or text/number value).| 
 +\\  
 +====Match mode settings==== 
 +^Mode^Description^ 
 +|Contains|A lookup value is returned if the source value contains it. For example"torwould be returned if the source value\\ was "Mo__tor__ola".| 
 +|Starts with|A lookup value is returned if the source value starts with it.  For example, "Motowould be returned if the source value\\ was "__Moto__rola".| 
 +|Ends with|A lookup value is returned if the source value ends with it.  For example, "rolawould be returned if the source value\\ was "Moto__rola__".| 
 +|Fuzzy|A lookup value is returned if the source value is within the specified //edit distance//.\\  The [[https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance|Damerau–Levenshtein edit distance]] measures the number of edit operations required to produce one word\\ from another.
 +|Max. edit distance|This setting appears when the //Match mode// is set to "Fuzzy" Choose the edit distance used by the Fuzzy-matching\\ process See the //Fuzzy// mode, above.|
  
-===See also===+\\  
 +=====Examples===== 
 + 
 +**Example:** Match the source value to any of the lookup values. (Illustrates the example statements given above in the //Match mode settings// table)\\ 
 +\\   
 +**Table 1:** Source value 
 +^Source text^ 
 +|Motorola| 
 + 
 +**Table 2:** Lookup table 
 +^Lookup values^ 
 +|tor| 
 +|Moto| 
 +|rola| 
 +|Motrola| 
 + 
 +\\  
 +**Action parameters:** 
 +>Column is "Source text" (in Table 1) 
 +>Lookup table is "Table 2" 
 +>Lookup column is "Lookup values" 
 +>Case sensitive is unchecked. 
 +>If not matched, "Make empty" 
 + 
 +\\  
 +Using the two tables and parameters above, the following tables show the results of the given settings.\\ 
 +\\  
 +>**Contains** match mode: 
 + 
 +^Source value^ 
 +|tor| 
 +\\  
 +>**Starts with** match mode: 
 +  
 +^Source value^ 
 +|Moto| 
 +\\  
 +>**Ends with** match mode: 
 +  
 +^Source value^ 
 +|rola| 
 +\\  
 +>**Fuzzy** match mode (max edit distance of 1): 
 +  
 +^Source value^ 
 +|Motrola| 
 + 
 +\\  
 +====Community examples==== 
 +  * [[https://community.easymorph.com/t//1551/2|How to look up and replace a string of text]] ([[https://community.easymorph.com/uploads/short-url/dvCtD7gg0AHUtXZ7tmQmuHflSYU.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //Table 3//; Action position: //3//) 
 +  * [[https://community.easymorph.com/t//1817/5|Substring Query]] ([[https://community.easymorph.com/uploads/short-url/sUDlB2uHCazeCdBqFSik6tCvu9r.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //Table 1//; Action position: //3//) 
 +  * [[https://community.easymorph.com/t//1849/4|Iterate through a set of column]] ([[https://community.easymorph.com/uploads/short-url/5icrGfTGgzbmG2l5AuSiqb43QvR.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //in.csv//; Action position: //5//) 
 + 
 +\\  
 +=====See also=====
   * [[transformations:lookup|Lookup]]   * [[transformations:lookup|Lookup]]
-  * [[syntax:functions:contains|Contains(texttext)]] +  * [[syntax:functions:contains|Function syntax: Contains(textAtextB)]] 
-  * [[syntax:functions:startswith|StartsWith(texttext)]] +  * [[syntax:functions:startswith|Function syntax:  StartsWith(textAtextB)]] 
-  * [[syntax:functions:endswith|EndsWith(texttext)]] +  * [[syntax:functions:endswith|Function syntax:  EndsWith(textAtextB)]] 
-  * [[syntax:functions:distance|Distance(texttext)]]+  * [[syntax:functions:distance|Function syntax:  Distance(textAtextB)]]
  
transformations/match.1534357296.txt.gz · Last modified: 2018/08/15 14:21 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki