Connecting to Multiple Tables

  1. In the Connection dialog box, complete the connection information according to the examples described in Examples - Connecting to Data Sources.
  2. Select the table or view you want to start with (typically the fact table) and then select the Multiple Tables option.

  3. Click the Add New Table button at the bottom of the dialog box.

  4. In the Add Table dialog box select a table to add to the Data window.

  5. Optionally change Field aliases.
    In the bottom half of the Add Table dialog box, there is a list of fields with their aliases. Double-click the field alias to change how the field will be displayed in the Data window. This is often useful when you have duplicate field names across tables or your field names are not very understandable.
  6. Add a join by selecting the Join tab.
    Tableau will automatically create a join for you based on the structure of your data. Select the Joins tab to inspect the join clause to make sure it is how you want to connect the tables.
    You can delete unwanted join clauses by selecting it in the list of join clauses and clicking Delete.
  7. In the Join pane, add one or more join clauses by selecting a field from the original table, a field from the added table, and an operator. Then click Add to add it to the list of Join Clauses.
    For example, in a data source that has a table of order information and another for users information, you could join the two tables based on the Region field that exists in both tables. Select Region in both the lists of fields, select the equal sign as the operator, and click Add.

  8. Select the type of join from the Join Type drop-down list. You can select Inner, Left, or Right.
    Please note, you cannot nest Inner joins within Left or Right joins. These joins will cause a join expression not supported error.
  9. When finished, click OK.
    The tables are listed in the Connection dialog box along with the foreign keys.
  10. Complete the connection by giving it a name and clicking OK.
When you add joined tables, the Data window is automatically organized to use the Group by Table command. You can turn this feature off or change how the Data window is sorted using the Data window menu.

1 comment: