Use enrichment as intersection activity
When using the intersection activity, you can prepare yourself for a lot of headaches, as the activity is as fragile as a soap bubble. I will show you how to make enrichment work as an intersection between two or more inbound populations that could be of different targeting dimensions.
Enrichment is one of the activities that can take multiple inbound populations and process them together using joins, similar to how you would when writing your own SQL query. If you want to get familiar more with enrichment I recommend you to read my enrichment dedicated blog article.
Here is the step by step tutorial on how to make enrichment work as intersection
Add all transitions into enrichment activity
Mostly we join two inbound populations (tables) but you can add as many you feel like is not going to ruin you mentally. Simply connect transitions to an enrichment activity.
Add data as a link
Next step obviously is to connect the dots and create as many links as many joins we want to make.
On the next step of the wizard, we can define our join. Whether it will be left, right, or inner depends on what you need to do.
- Left Join: Includes all records from the left table and the matched records from the right table. Unmatched records from the left table will appear with null values for columns from the right table.
- Right Join: Includes all records from the right table and the matched records from the left table. Unmatched records from the right table will appear with null values for columns from the left table.
- Inner Join: Includes only the records that have matching values in both tables.
The type of join is defined in “Link type” section also we define cardinality.
- One-to-One: Each row in Table A matches one row in Table B.
- One-to-Many: Each row in Table A matches multiple rows in Table B.
- Many-to-Many: Rows in Table A can match multiple rows in Table B and vice versa.
For the “Link target”, we select one of the remaining inbound populations or data sets we want to join together with the main set.
Add split
Depending on the cardinality used, your population will drop, stay the same, or increase. It depends on your end goal. For example, consider the following scenario where I want to append a list containing my recipients’ consents. I want to see who has opted in and who has opted out. For us, it is best to use “Define a link whose target may not exist in the database.” We will not have any drop in the population, but as with a left join, some of the attached records from the joined data set will be empty. In the split, we can then simply add a condition to see whether we have joined data or not by comparing any column to see if it is not empty.