Simple transformations
Tableau is not a data preparation tool. It's always better to have a clean file to start with. However, Tableau offers some simple transformation tools. When you connect to a dataset, you can, for example, use the Data Interpreter, split a column into multiple columns, or pivot your data. Let's see a case for these transformations.
For this section, I created a dataset to clean in Excel, as illustrated here:
Note
If you want to reproduce the example, you can download the Dataset to clean
file from my website, https://tableau2019.ladataviz.com, as discussed in Chapter 4: Connecting to Data and Simple Transformation section, or use this direct link: https://ladataviz.com/wp-content/uploads/2018/09/Data-duplication-example.xlsx.
Three things are problematic with this dataset:
- There is a column header for the years
- The countries and the cities are in the same column
- Each year is in a different column, preventing the creation of a simple line chart
Now, let's fix...