Match & Map
This guide explains how to use the Match & Map enrichment to add new values to your data extract using existing values.
Introduction
Use the Match & Map enrichment 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 enrichment to add descriptions to acronyms or assign values to dimensions. For example, use the Match & Map Enrichment 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 enrichment, you can provide a lookup table (this contains a set of the values to match and the corresponding target values to map). This enrichment is a more user-friendly version of the map custom script.
Concept
Enriching your data means transforming and tailoring the data according to your needs. An enrichment is a set of instructions that you specify for Adverity to transform your data.
When you create an enrichment, you add it to the list of available enrichments in the workspace.
When you assign an enrichment to a datastream, each time data is fetched for the datastream, the data is transformed according to the enrichment. The enrichment only has an effect on datastreams to which you assign the enrichment.
Prerequisites
Before you complete the procedure in this guide, perform all of the following actions:
-
Create a datastream. For more information, see Introduction to collecting data.
-
Apply the correct Data Mapping for your datastream. For more information, see Introduction to harmonizing data.
-
Make sure that the data table fetched from the datastream contains the dimension you want to match and map.
Procedure
To create a Match & Map enrichment for a datastream, follow these steps:
-
Select the workspace you work with in Adverity and then, in the , click Enrichments.
-
In the top right corner, click + Create Enrichment.
-
Click Match & Map.
-
(Optional) To assign the enrichment to individual datastreams of your choice, follow these steps:
-
In the Assign to section, select Individual datastreams.
-
In the drop-down menu, select the datastreams to assign the enrichment to them.
-
-
(Optional) To assign the enrichment to all existing and new datastreams that belong to Datastream Types of your choice, follow these steps:
-
In the Assign to section, select Datastreams Types.
-
In the drop-down menu, select the Datastream Types to assign the enrichment to all datastreams that belong to these types.
-
(Optional) In the Do not assign to these individual datastreams drop-down menu, select the individual datastreams that belong to the Datastream Types that you have selected, but you do not want to assign the enrichment to them.
-
-
Click Next.
-
In the Define the columns to work with section of the enrichment configuration, 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, check the datastream Data Mapping and make sure the Target column has a value in each row.
-
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 right side of the page, click Apply.
-
In the Do you have a lookup table to import? section of the enrichment configuration, choose one of the following options:
-
To add your new match and map values to the enrichment, select No, I need a new Lookup table and follow the rest of the procedure from step 10.
-
To add an existing lookup table to the enrichment, select Yes, I have a Lookup table and follow these steps:
-
To upload a lookup table file, click on the Import values tab and click to upload the lookup table file.
-
(Optional) To enter the values without uploading a file, click on the Paste values from external file tab and paste in the values to match and map separated with a comma. Enter the values in the following format:
value_to_match,value_to_map
-
Click Apply.
-
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.
-
-
If you are entering new match and map values, in the Lookup Table section of the enrichment configuration, enter the values into the following fields:
-
WHEN
-
In each row, enter the value to match. For example, enter the name of the acronym on to which to map a description.
(Optional) Click
Autofill values to automatically populate the WHEN column fields with the unique values from the selected Original column based on the last data extracts.
When creating a Match & Map enrichment for the first time, a Suggested Autofill window appears. Choose one of the following options:
-
Autofill
-
Click this option to automatically populate the WHEN fields with the unique values from the selected column in the Original column field. Alternatively, click
Autofill Values to the right of the Lookup Table section.
-
No Thanks
-
Manually populate the values in the WHEN column.
Above the fields is a drop-down menu that lets you choose how to match the data. By default, the option Exactly matches is chosen, meaning the values entered into the fields must be an exact match to those in the data extract. For more information on the other match options, see Alternative Match options.
-
-
THEN
-
In each row, enter the target value to map. For example, enter the description for the matched acronym. 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 of the enrichment configuration, chose one of the following options:
-
Leave the table unchanged
-
If Adverity finds a value to match that is not in the WHEN column, then the corresponding field in the new column in the data extract is left blank.
-
Add new values
-
If Adverity finds a value to match that is not in the WHEN column, this new value is added to the corresponding field of the new column in the data extract.
-
Add new values and notify me
-
If Adverity finds a value to match that is not in the WHEN column, this new value is added to the corresponding field of the new column in the data extract and a notification email is sent out to inform the recipient of this new addition. You can control who receives the notification emails through the subscriptions set up in the administration section. For more information, see Setting up notifications.
-
-
Click Next.
-
(Optional) In Enrichment name, rename the enrichment.
-
Click Create +.
Adverity will apply the Match & Map enrichment to all future data extracts you fetch with the datastream. For more information, see Collecting and viewing data.
Alternative Match options
If you are entering new match and map values, in the Lookup Table section of the enrichment configuration you can determine how the values are matched.
Above the fields in the WHEN column, there is a drop-down menu that lets you choose how to match the data. The location of this field is shown in the image below.
The location of the Match type drop-down field.
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.
-
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.
-
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.
-
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.
-
Regex
-
Find values in the Original column using a regular expression.