Tables that are linked to the same query or data model are called mergeable tables. Two mergeable tables can be merged into a single table while preserving the original relationships in the data. This simply means that rows in the two tables that correspond to the same data record are merged together.
The merge effectively provides just another view of the same query or data model, and does not entail any new joins.
To merge two mergeable tables in a Data Worksheet, follow these steps:
1. Drag the first table to the left or right side of the second table. Position the dragged table so that its border touches the border of the second table.
2. When the merge icon appears, release the dragged table. The dragged table will be merged into the second table.
When the tables are merged, the columns of the first (dragged) table are added to the right side of the second table, with corresponding rows of the two tables merged together. (The first table is left unaltered.) Filtering conditions that are defined on the second table are retained in the merged table, but filtering conditions defined on the first table are dropped. A merged table cannot be split. If two tables are not mergeable, the above steps will produce a new cross-joined table rather than a merged table.
#1 Ranking: Read how InetSoft was rated #1 for user adoption in G2's user survey-based index |
|
Read More |
Note that a Merged table is not the same as Merge-Joined table. A Merge Join simply appends the columns of one table to another, with no relationship governing the row pairing.
The following example illustrates the difference between merging tables and cross-joining tables. First, consider the case of two mergeable tables (tables linked to the same query or a data model):
1. Create a new Worksheet by clicking on the 'New Worksheet' button.
2. Expand the 'Query' node, then the 'Orders' node, and the 'Order Model' node.
3. Drag the 'Order' entity on to one of the empty cells on the Worksheet. A new table, 'Order1' is created.
4. Drag the 'Salesperson' entity on to one of the empty cells in the Worksheet. A new table, 'Salesperson1' is created.
5. Now click on the title row of the 'Salesperson1' table, hold down the left mouse button and drag it near the 'Order1' table so that the two tables are laid side-by-side. Notice the merge icon which indicates that the two tables will be merged together.
6. Release the left mouse button to merge the two tables. Because the 'Order1' and 'Salesperson1' tables are bound to entities from the same data model, the 'Order1' table is modified to include the columns of the 'Salesperson1' table. No new tables are created.
7. Right-click on the title row of the 'Order1' table and select 'Preview' to see the merged table.
8. Close the 'Preview' window.
Next, consider the case of two non-mergeable tables (tables linked to different queries or a data models).
9. Drag the 'Sales by Employee' node on to one of the empty cells on the Worksheet. A new table, 'Sales by Employee1' is created.
10. Now click on the title row of the 'Sales by Employee1' table, hold down the left mouse button and drag it near the 'Salesperson1' table so that the two tables are laid side-by-side.
11. Release the left mouse button to cross-join the tables. Because the two tables do not share the same data model or a query, they are not merged together. Instead, a cross join is created between them, producing a new 'Query1' table.
12. Preview the 'Query' table.