For this example, I created an Excel file with two sheets to Union.
The Union example Excel file contains two sheets:
- One named 2017, which contains the data shown in the following screenshot:
- One named 2018, with the data shown in the following screenshot:
As you can see, the two sheets have the same column name. In Tableau, after connecting to the Excel file, there are two ways of making a Union:
-
The first way: Drag and drop the 2017 table, then drag and drop the second table, 2018, just beneath the first one, where it says Drag table to union:
- The second way: Drag an drop New Union, as shown in the following screenshot:
It opens a new window where you can drag and drop the two tables to Union them:
No matter the way, the result of the Union is a Data Source that combines the two tables. Tableau also creates new columns that indicate the name of the table where the data comes from. The following screenshot shows you the final result:
To end this chapter about data connections, let's see some of the transformations you can apply to the Data Source.