Mapping tables serve as a dictionary between source value (Match, left column) and target value (Value, right column).
They work similarly to a V-Lookup: if a value matches the left column the corresponding value of the right column is inserted into the field. You can also include Regular Expressions in the match column, as described below.
EXAMPLE 1 - Manual Mapping
-
Navigate to Enrich.
-
a. Go to "Mapping Tables";
b. Click "+Add". -
Click "+Add another entry" and begin manually populating the mapping table, where "Match" equals the value to search for in the source data, and "Value" equals the new value that will replace it.
Example Input 1dim_A metric_1 UK 111 DE 222 US 333 Example Output 1dim_A New_Column metric_1 UK United Kingdom 111 DE Germany 222 US United States 333
EXAMPLE 2 - Using Regex Expressions
- Put '/' at the start and end of the entry to convert it into a regular expression. In the table below anything starting with 'DE_' would be translated to 'Germany'.
Example Input 2
dim_A metric_1 DE_Munich 111 DE_Berlin 222 DE_Frankfurt 333 Example Output 2dim_A New_Column metric_1 DE_Munich Germany 111 DE_Berlin Germany 222 DE_Frankfurt Germany 333
USING REGEX EXPRESSIONS IN MAPPING TABLES
Within mapping tables, the following entries can be used on the left-hand side of the table:
- /.*adwords.*/ -> everything that contains "adwords"
- /adwords.*/ -> everything that starts with "adwords"
- /.*adwords/ -> everything that ends with "adwords"
- /(A|a)dwords/ -> everything that is exactly "Adwords" or "adwords"
- /.*(a|A)dwords.*/ -> combination of multiple is possible
We suggest you use regex101 or a similar regular expression tool to test your regular expressions.
Please note that mapping entries are checked in order: top-down.
Comments
0 comments
Article is closed for comments.