Table of Contents
CROSS MERGE
Category: Transform / Advanced
Description
This action creates a table with all possible combinations (i.e. Cartesian product) of rows in two tables.
Use cases
Cross Merge can be helpful in a number of cases:
- Generating a custom calendar
- Performing a complex merging/matching, where all possible combinations are later filtered using a complex condition.
Action settings
Setting | Description |
---|---|
Merge table | Select the table to merge with the current dataset. |
Columns | Select whether to merge all columns in the second dataset, or just selected columns. Options: All columns or Selected columns (choose which columns to include in the merge). |
The reference to the second table will appear as a dotted line connecting this action to the second dataset in the application window.
Remarks
This action can produce extremely large tables, so make sure that you’re not cross-merging large tables. To estimate the number of rows in the resulting table, multiply the number of rows in both source datasets.
EasyMorph can handle tables with up to 536 million records only.
Examples
Example: Create a custom calendar with quarters in years 2016-2017.
Table: Years
Year |
---|
2016 |
2017 |
Table: Quarters
Quarter |
---|
Q1 |
Q2 |
Q3 |
Q4 |
Action parameters:
Merge table: "Quarters"
All columns
(The resulting dataset will contain 8 rows. Table "Years" 2 rows x Table "Quarters" 4 rows.)
Result table:
Year | Quarter |
---|---|
2016 | Q1 |
2016 | Q2 |
2016 | Q3 |
2016 | Q4 |
2017 | Q1 |
2017 | Q2 |
2017 | Q3 |
2017 | Q4 |
Community examples
- Breaking change in v4.4: Aggregate with Concatenate and grouping (Project; Module: Main; Group: Tab 1; Table: Sample data;
Action position: 3) - My first experiment API + conditional workflow + iteration (Project; Module: Process Network ID; Group: Create company data table; Table: Tabular Data; Action position: 6)