Pivoting Data in Tableau
Pivoting data in a table involves reorganizing the rows and columns to create a summary of the data. Two common ways to pivot data are “pivot rows to columns” and “pivot columns to rows”.
“Pivot rows to columns” is a method where the values in a row are transformed into columns. This method is commonly used when we want to summarize data that is organized in rows. For example, let’s say we have a table that lists sales data by product and year. If we pivot the rows to columns, we can summarize the data by year and see the sales for each product in a given year. This method is also called “wide format” since it creates a table with more columns than rows.
“Pivot columns to rows” is a method where the values in a column are transformed into rows. This method is commonly used when we want to summarize data that is organized in columns. For example, let’s say we have a table that lists sales data by region and product. If we pivot the columns to rows, we can summarize the data by product and see the sales for each region for a given product. This method is also called “long format” since it creates a table with more rows than columns.
In summary, the choice between “pivot rows to columns” and “pivot columns to rows” depends on the nature of the data and the desired summary format. Both methods are useful for summarizing data and presenting it in a more concise and readable format.