REPLACE WITH LOOKUP
Category: Transform / Advanced
This action replaces substrings in one or more columns using a lookup table.
|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).
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.
Example: Convert the abbreviated values in the "Address Line 2" field with their full-text versions.
Table 1: Source table
|Address Line 2|
Table 2: Lookup table
Lookup table is "Table 2"
Substrings in is "Source"
Replace with is "Output"
Replace in all columns
|Address Line 2|
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.