Cross Joins
A Cross Join (also known as a Cartesian product) is a specific type of relationship you can choose when joining two Data Extensions. This relationship type is labelled as EACH FROM [A] WITH EACH FROM [B].
Cross Joins are ideal when you need a list of all possible combinations. For example, if you want to validate the correctness of the different marketing campaign versions you are sending: Perform a Cross Join between an Internal Data Extension containing your team members and Campaign Version Data Extension and you have your list ready to test out all the different iterations of your campaign messages. Beforehand, you could first generate test sends, and make sure that everyone in the Data Extension receives each version for validation purposes before the actual send-out.
How it works
Unlike standard relationships, a Cross Join does not require you to define matching fields. Instead, it automatically generates a paired combination of every single row from your first Data Extension with every single row from your second Data Extension. As a result, the total number of records generated equals the number of rows in the first Data Extension multiplied by the number of rows in the second.
Best practices
- There’s no field matching required in this type of join as it will create combinations between each row in both Data Extensions.
- It is recommended to not use more than one Cross Join in a selection as running such a selection may result in inconsistency in the number of records returned.
- If you are only mapping one primary key, the following warning will pop-up: You only have one primary key mapped for Cross Join. This may result in unexpected results due to primary key constraints. Please remove the primary key or add a primary key from the second Data Extension in the Cross Join.