{{ transformations:ReplaceWithLookupAction.png}} ====== REPLACE WITH LOOKUP ====== Category: Transform / Advanced\\ \\ =====Description===== This action replaces substrings in one or more columns using a lookup table.\\ \\ =====Action settings===== ^Setting^Description^ |Lookup table|Select the dataset to be used for the lookup.| |Substrings in|Select the column containing the lookup values in the lookup table.| |Replace with|Select the column containing the replacement values in the lookup table.| |Replace in columns|Select whether to perform the replacements in all columns or specified columns. Options: //Replace in all columns// or\\ //Replace in selected columns// (and select which columns to perform the replacements in).| \\ =====Remarks===== Order of the records in the lookup table matters. Replacements occur in the order they are encountered in the lookup table. If a substring is replaced in an earlier match, an expected replacement may no longer apply. A source value may undergo multiple replacements based on its content at the time each lookup record is processed. The matching of the source table's values to the lookup table's "Substrings in" field's values is case-sensitive. (e.g., "The" will not match with "the".) Be sure to include all case combinations that may occur in the lookup table. \\ =====Examples===== **Example:** Convert the abbreviated values in the "Address Line 2" field with their full-text versions.\\ \\ **Table 1:** Source table ^Address Line 2^ |Apt 2| |St. A| |st 422| |6th flr| |apt 12| |flr 8| **Table 2:** Lookup table ^Source^Output^ |St.|Suite| |St|Suite| |st.|Suite| |st|Suite| |Apt.|Apartment| |Apt|Apartment| |apt.|Apartment| |apt|Apartment| |Flr.|Floor| |Flr|Floor| |flr.|Floor| |flr|Floor| \\ **Action parameters:** >Lookup table is "Table 2" >Substrings in is "Source" >Replace with is "Output" >Replace in all columns \\ **Result table** ^Address Line 2^ |Apartment 2| |Suite A| |Suite 422| |6th Floor| |Apartment 12| |Floor 8| \\ Note how the values in the "Source" column of the Lookup table took into account both capitalized and uncapitalized versions of the lookup values, as well as versions having trailing periods.\\ \\ =====See also===== * [[transformations:lookup|Lookup]] * [[syntax:functions:contains|Function syntax: Contains(textA, textB)]] * [[syntax:functions:startswith|Function syntax: StartsWith(textA, textB)]] * [[syntax:functions:endswith|Function syntax: EndsWith(textA, textB)]] * [[syntax:functions:distance|Function syntax: Distance(textA, textB)]]