Match & Map
This guide explains how to use the Match & Map transformation to add new values to your data extract using existing values.
Introduction
Use the Match & Map transformation to find certain values in your data extract (this is known as matching) and create new values based on these matched values (this is known as mapping). Use the Match & Map transformation to add descriptions to acronyms or assign values to dimensions. For example, use the Match & Map transformation to achieve the following:
-
Find certain values in your data. For example, an acronym like bis.
-
Map target values on to the values you have found. For example, map the target value Back in stock on to the value bis.
-
Create a new column that contains the mapped values. For example, the row which contained the matched value bis will then also contain a new column with the mapped value Back in stock.
When configuring the transformation, you can provide a lookup table (this contains a set of the values to match and the corresponding target values to map). This transformation is a more user-friendly version of the map custom script.
This video guide explains how to create and configure a Match & Map transformation.
Prerequisites
Before you complete the procedure in this guide, perform all of the following actions:
-
Make sure that the data extract fetched from the datastream contains the dimension you want to match and map.
Configuring the Match & Map transformation
This guide explains how to configure the Match & Map transformation. Before completing this step, start creating a transformation by following the instructions in Using standard transformations. To configure this transformation, follow these steps:
-
In the Define the columns to work with section, fill in the following fields:
-
Original column
-
In the drop down menu, select the column that contains the values to match.
If the drop down field does not contain the column with the values to match, make sure you have applied the correct Data Mapping to your datastream.
-
New column
-
Enter the name of the new column to be added to the data extract. This new column is populated with the mapped values.
-
-
In the bottom right corner of this section, click Apply.
-
In the Do you have a lookup table to import? section, choose one of the following options:
-
To add new match and map values to the transformation, select No, I need a new lookup table and continue from step 4 of this guide.
-
To use an existing lookup table to configure the transformation, select Yes, I have a lookup table and follow these steps:
-
In the pop-up dialog, to upload a lookup table, click to upload your lookup table.
-
(Optional) To enter the values without uploading a file, click the Paste values from external file tab and enter the values to match and map in this format
value_to_match,value_to_map
.Make sure you do not include the header of the file when uploading the lookup table or when pasting the values into the Paste values field.
-
Click Apply.
-
In the Lookup table section, click Apply.
-
Continue from step 6 of this guide.
-
-
-
If you are entering new match and map values, in the Lookup table section of the transformation configuration, configure the following settings:
-
WHEN
-
In each row, enter a value to match.
(Optional) Click Autofill values to automatically populate the WHEN column fields with all unique values in the original column you selected, based on the latest data extract.
-
Exactly matches (and other options)
-
In the drop-down menu above the values in the WHEN column, choose how to match the data. By default, the option Exactly matches is chosen - this means that the values entered in the WHEN column must be identical to the values in the data extract. For more information on the other match options, see Match options.
-
THEN
-
In each row, enter the target value to map. The values entered here are used to populate the new column of the data extract.
-
To add a new row to the lookup table, click to the right of a row.
-
-
Click Apply.
-
In the When Adverity detects new values in the datastream section, choose one of the following options:
-
Leave the table unchanged
-
If Adverity finds a value in the original column that is not in the WHEN column, then the corresponding row in the new column in the data extract is left blank.
-
Add new values
-
If Adverity finds a value in the original column that is not in the WHEN column, this value is added to the corresponding row in the new column in the data extract.
-
Add new values and notify me
-
If Adverity finds a value in the original column that is not in the WHEN column, this value is added to the corresponding row in the new column in the data extract and a notification email is sent out to inform the recipient that a new value has been found. You can control who receives the notification emails through the subscriptions set up in the administration section. For more information, see Managing user notifications.
-
You can preview your transformation in the Preview tab. Here, you can see how your current transformation instructions will transform the data you have previously collected using the selected datastream.
Click Refresh Preview at the bottom of the Configuration tab to see the preview of your latest changes.
For more information about the preview, see Previewing transformations.
Match options
If you are entering new match and map values, in the Lookup table section, you can determine how the values are matched.
By default, the option Exactly matches is chosen. The match options are as follows:
-
Exactly matches
-
The values entered in this field must exactly match the values in the selected original column. This search is case sensitive.
-
For example, if you select this option and enter Squirtle, Adverity will only match the value Squirtle in the original column.
-
Exactly matches - Case insensitive
-
The values entered in this field must exactly match the values in the selected original column. This search is not case sensitive.
-
For example, if you select this option and enter Bulbasaur, Adverity will match Bulbasaur or bulbasaur in the original column.
-
Contains
-
Find values in the original column that contain the values entered in this field. For example, use this match type to search for the name of Campaigns that contain a certain keyword. This search is case-sensitive.
-
For example, if you select this option and enter Char, Adverity will match Charmander and Charmeleon in the original column, but not charizard.
-
Contains - Case insensitive
-
Find values in the original column that contain the values entered in this field. For example, use this match type to search for the name of Campaigns that contain a certain keyword. This search is not case-sensitive.
-
For example, if you select this option and enter pi, Adverity will match Pikachu and pichu in the original column.
-
Regex
-
Find values in the original column using a regular expression.