A Union example

For this example, I created an Excel file with two sheets to Union.

If you want to reproduce the example, you can download the Union example file from my website, book.ladataviz.com, in the section Chapter 4: Connect To Data and Simple Transformation section, or use this direct link: https://ladataviz.com/wp-content/uploads/2018/09/Union-example.xlsx.

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 Unionas 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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.239.44