Chapter 6: Pivoting Data
You may encounter a scenario where analyzing data is complicated by the way the data is structured. For example, you may prefer to have columns as rows or vice versa. For example, you may have a column in your dataset with a true/false value for each product category. However, your data visualization would be easier to achieve if you had a single column for the product category, with the row value indicating the category name. In this chapter, you'll learn how to pivot your data from columns to rows and vice versa. The goal of pivoting is to ensure your data has the optimal shape required for your downstream analytics goals, for example, creating a dashboard in Tableau Desktop. Mastering the pivot functionality is an essential tool in your data transformation skillset.
In this chapter, you'll find the following recipes to help you pivot your data for analytics:
- Pivoting columns to rows
- Pivoting columns to rows using wildcards
- Pivoting...