Unions
Sometimes you might want to analyze data with the same metadata structure that is stored in different files – for example, sales data from multiple years, different months, or countries. Instead of copying and pasting the data, you can union it. We already touched upon this topic in Chapter 3, Using Tableau Prep Builder, but a union is basically where Tableau will append new rows of data to existing columns with the same header. For the following exercise, we will use FIFA data (from the PlayStation game, not the World Cup). The data is from Kaggle (https://www.kaggle.com/datasets/stefanoleone992/fifa-22-complete-player-dataset?resource=download) and ships in multiple CSVs; each CSV contains data for one year and male/female are split too.
For our analysis, we want to combine all the files into one. Hence, we need to union, by taking the following steps:
- Download the CSV files from GitHub (https://github.com/PacktPublishing/Mastering-Tableau-2023-Fourth...