Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Tableau data connection


May 26, 2021 Tableau



Data connectivity is a common requirement for any data analysis. You may need to connect data from different tables in a single source, or from multiple sources.

Tableau provides the ability to connect tables using the data panes provided in the Data menu.

A connection means combining columns of one or more tables in a relationship database. It also creates a collection that can be saved as a table, or it can be used as is.

There are five types of connections specified:

  • Cross-connection.
  • The internal connection.
  • Natural connection.
  • external connection. T he outer left connection. T he outer right connection. F ull external connection.
  • Self-connection.

1. Overview of connection types

The connection section is used to combine rows from two or more tables, based on the related columns between them. 1. Cross-connection: The rows generated by the cross-connection combine each row in the first table with each row in the second table.

Tableau data connection

2. Internal join: The inner join returns a matching row in the table being connected.

Tableau data connection

3. Natural connection: Natural connection does not use any comparison operator. I t has no connection. I f there is at least one common property between two relationships, only natural connections can be performed. I n addition, the property must have the same name and domain. Natural connections apply to those matching properties, where the property values in both relationships are the same.

4. External connection: External connection is an extended form of internal connection. It returns matching and non-matching rows of the table being connected.

The types of external connections are as follows:

4.1. Left-out connection: The left-out connection returns the matching row in the table being connected, as well as the mismatched row in the left table in the result, and places the NULL value in the property from the right table.

Tableau data connection

4.2. Right-out connection: The right-out connection operation returns the matching row in the table being connected, as well as the mismatched row in the right table in the result, and places the NULL value in the property from the left table.

Tableau data connection

4.3. Full outer join: Full outer join for combining tables. T herefore, it contains all the values in both tables. When a value in a table does not match another table, it returns the NULL value in the data grid.

Tableau data connection

5.1. Self-join: Self-join is used to connect the table to itself. This means that each row of a table is combined with itself and with each row of the table.

2. Create a join in Tableau

Let's assume that a data source, Sample-superstore, creates a connection between two tables, such as Orders and Returns.

  • Go to the Data menu and select the Microsoft Excel option below to connect.
  • Then select sample-superstore as the data source and click the Open button.
  • Drag the Orders and Returns tables from the data source worksheet into the data pane. Tableau then automatically creates a connection between the Orders and Returns tables, which can be changed later depending on the connection you want.

Tableau data connection

The following screenshot shows an internal connection between the Orders and Returns tables using the Order id field.

Tableau data connection

3. Edit the join type in Tableau

Tableau automatically creates a connection type between the two tables, but you can make changes as needed.

  • Click to display the middle of the two circles of the automatically created connection.
  • When clicked, a pop-up window appears showing all four types of connections.
  • In the following screenshot, you can see all the connections, such as: inner join, left outer join, right outer join, and full join outer.

Tableau data connection

4. How to edit the connection field in Tableau

You can change the field by clicking the Data Source option to add a new connection clause that is available in the connection pop-up window. When you select a field, you can use the search text box to search for the field.

Tableau data connection