Join tables
Concept Information
Using a common key field from each table, you can join two Analytics tables with different record structures into a new third table. The fields contained in the third table can be any combination of fields from the two original tables.
Note
Carefully identify the primary and secondary tables in a join because results can differ if you reverse the order. For more information, see Common uses of joining or relating.
Steps
Note
Detailed information appears after the steps. See Join dialog box options.
- In the Navigator, open the primary table, and right-click the secondary table
and select Open as Secondary.
The primary and secondary table icons update with the numbers 1 and 2 to indicate their relation to each other .
- Select Data > Join.
- On the Main tab:
- Select the join type.
Join types are explained below.
- Select the primary key field from the Primary Keys list.
- Select the secondary key field from the Secondary Keys list.
- Select the fields to include in the joined
table from the Primary
Fields and Secondary Fields lists.
Note
You must explicitly select the primary and secondary key fields if you want to include them in the joined table.
Tip
You can Ctrl+click to select multiple non-adjacent fields, and Shift+click to select multiple adjacent fields.
- Select the join type.
- In the To text box, specify the name of the new, joined table.
- (Optional) On the More tab:
- If you want to process only a subset of records, select one of the options in the Scope panel.
- If you want to append (add) the output results to the end of an existing Analytics table, select Append To Existing File.
- Click OK.
The new, joined table is output.
Join dialog box options
The tables below provide detailed information about the options in the Join dialog box.
Main tab
Options – Join dialog box | Description |
---|---|
Join Types |
Specifies which Analytics join type to use. For detailed information, see Which records are included in the joined table? |
Matched primary and secondary (first secondary match)
|
The joined output table contains:
|
Matched primary and secondary (all secondary matches)
|
The joined output table contains:
|
Unmatched primary
|
The joined output table contains:
|
All primary and matched secondary
|
The joined output table contains:
|
All secondary and matched primary
|
The joined output table contains:
|
All primary and secondary
|
The joined output table contains:
|
Secondary Table | An alternate method for selecting the secondary table. |
Primary
Keys
Secondary Keys |
Specifies the common key field to use to join the two tables.
Key field guidelines:
|
Primary
Fields
Secondary Fields |
Specifies the fields to include in the joined
table.
|
Presort Primary Table
Presort Secondary Table |
Sorts the primary or secondary tables by their key field, or fields.
|
Local |
If you are connected to a server table, specifies where to save the joined table.
|
Use Output Table | Specifies whether the Analytics table containing the output results opens automatically upon completion of the operation. |
If |
(Optional) Allows you to create a condition to exclude records from processing.
|
To | Specifies the name and location of the output table.
Regardless of where you save the output table, it is added to the open project if it is not already in the project. If Analytics prefills a table name, you can accept the prefilled name, or change it. Note Analytics table names are limited to 64 alphanumeric characters, not including the .FIL extension. The name can include the underscore character ( _ ), but no other special characters, or any spaces. The name cannot start with a number. |
More tab
Options – Join dialog box | Description |
---|---|
Scope panel | Specifies which records in the primary table are processed:
Note The number of records specified in the First or Next options references either the physical or the indexed order of records in a table, and disregards any filtering or quick sorting applied to the view. However, results of analytical operations respect any filtering. If a view is quick sorted, Next behaves like First. |
Append To Existing File | Specifies that the output results are appended (added) to the end of
an existing Analytics table. Note Leaving Append To Existing File deselected is recommended if you are uncertain whether the output results and the existing table have an identical data structure. For more information about appending and data structure, see Appending output results to an existing table. |
OK | Executes the operation.
|