5.2.4 Merge Join

The Merge Join is a special type of join that creates no relationship between the two base tables. The base tables are simply merged into a single table by collecting their columns together and placing corresponding rows side by side.

Note: A Merge-Joined table is not the same as a Merged table. See Merging Tables for information about merging tables that share the same query or model.

To create a merge join, follow these steps:

1. Select both tables by Ctrl-clicking on each table's title row.

2. Click the 'Join Table' button in the Worksheet toolbar, and select 'Merge Join'. A new merge-joined table is created.

In the merge-joined table, the columns of the shorter table are padded with empty rows to match the length of the longer table. The number of columns in the final merge-joined table is the sum of the columns in the two base tables.

Example: Merge Join  >>

For example, say you want to see all of the orders from the states of NY and NJ side by side. You can accomplish this by using the merge join.

1. Create a new Worksheet.

2. Expand the 'Data Source' node, the 'Orders' node, and the 'DWS' node.

3. Drag the 'NY Orders' node from the tree to an empty cell in the Worksheet. A new table named 'NY Orders1' is created.

4. Drag the 'NJ Orders' node from the tree to an empty cell in the Worksheet. A new table named 'NJ Orders1' is created.

5. Now select both the tables by holding down the Ctrl key and clicking on each table's title row.

6. Click on the 'Join Table' button on the top toolbar, and select 'Merge Join'. A new table, 'Query1' is created.

 

Since the merge join does not create any relationship between the tables, there is no connector shown. This join type, there­fore, cannot be changed.

7. Preview the 'Query1' table by right-clicking on the title row and selecting 'Preview'. Notice that since the 'NJ Orders1' table has more rows than the 'NY Orders1' table, the number of rows of the 'Query1' table is equal to the number of rows of the 'NJ Orders1' table. Also notice that the 'NY Orders1' table has two empty rows appended to it.

 

 

<< 5.2.3 Cross Join © 1996-2013 InetSoft Technology Corporation (v11.4) 5.2.5 Changing the Join Type >>