Joining Multiple Data Tables in the Joined Data Table Editor
In this section, we will discuss how to join the following data tables using two common fields.
Sample Data Table 1 (e.g., BidOfferTrade – Price)
Sample Data Table 2 (e.g., BidOfferTrade – Trade)
- Create a new joined data table by doing one of the following:
- Click
on the Data Library page, or
- Right-click on a folder or subfolder then select New Data Table in the context menu.
The New Data Table dialog displays.
- Click
- Enter the name of the joined data table then click
.
The Joined Data Table Editor displays.
- On the Join Settings pane, click
. The Add Data Table dialog displays.
- Click the data tables that will be joined. The selected data tables are now highlighted.
- Click
. The selected data tables are now added under the Join Settings pane.
- To join the data sources, click the Join
icon.
The icon changes to
and the Join Settings pane displays the join types you can use.
- Select the join Type:
- Left Outer Join
Keep all rows from the left table. When there are no matching values from the right table, empty values will be returned.
- Right Outer Join
Keep all rows from the right table. When there are no matching values from the left table, empty values will be returned.
- Full Outer Join
Returns all rows from both tables, whether they have a matching row or not.
- Inner Join
Select only rows from both tables for which the join keys match.
- Cross Join
Returns the Cartesian product of rows from tables in the join.
- Left Outer Join
- Click
.
The Left Column and Right Column drop-down lists are displayed.
- Select the unique ID from the Left Column data source from the drop-down list that will be used to match the unique ID from the Right Column data source (e.g., Item).
- Select the unique ID from the Right data source from the drop-down list (e.g., RatePrice).
- Click
then click
to expand the Data Preview pane.
The selected join type is displayed in the Join definition box and the data table of the joined data sources is loaded on the Data Sources Preview area.
- For the Left Outer Join, the joined table now displays seven rows based on the Item join key of the left table.
- For the Right Outer Join, the joined table now displays seven rows based on the RatePrice join key of the right table.
- For the Full Outer Join, the joined table now displays all rows that are matching or not matching based on the Item/RatePrice join keys of both tables.
- For the Inner Join, the joined table now displays seven rows based on the Item/RatePrice join keys of both tables.
- For the Cross Join, the joined table now displays twelve rows based on the combination of each row from the first table with each row from the second table.
Note that Join Keys definition is not available.
- For the Left Outer Join, the joined table now displays seven rows based on the Item join key of the left table.
- Now, let us add new left and right join keys. Click
on the Join Settings pane.
A new Left Column and Right Column entry displays.
- Select the left and right join keys (e.g., isodatetime and ISODateTime).
- Again, select the join Type.
- Click
.
The selected join type is displayed in the Join definition box and the data table of the joined data sources is loaded on the Data Sources Preview area.
- For the Left Outer Join, the joined table now displays three rows based on the Item and isodatetime join keys of the left table.
All the rows from the left table are kept. Note that for the rows with no matching values from the right table, empty values are returned.
- For the Right Other Join, the joined table now displays four rows based on the RatePrice and ISODateTime join keys of the right table.
All the rows from the right table are kept. Note that for the rows with no matching values from the left table, empty values are returned.
- For the Full Outer Join, the joined table now displays six rows from both tables. The first row is based on the Item/RatePrice and isodatetime/ISODateTime join keys of both tables while the next five rows are those that did not match the join keys.
- For the Inner Join, the joined table now displays one row based on the Item/RatePrice and isodatetime/ISODateTime join keys of both tables.
- For the Cross Join, the joined table now displays twelve rows based on the combination of each row from the first table with each row from the second table.
Note that Join Keys definition is not available.
- For the Left Outer Join, the joined table now displays three rows based on the Item and isodatetime join keys of the left table.
- To delete left and right join keys in the Join Settings pane, click
.
- Click
to save the join. Once saved, a notification message displays.
(c) 2013-2024 Altair Engineering Inc. All Rights Reserved.