# Tableau Prep Builder: Pivot / Transformations (Part 6 of 7)

> This is content from just-tim, the data-and-analytics channel by Tim Ngwena (formerly 'Tableau Tim'). Tim has 12+ years of hands-on BI experience and covers Tableau most of all, plus Power BI, Looker, Hex, SQL and data modelling, the analytics industry, and the craft of doing the job — always tool-agnostic and honest about the trade-offs.

- **Author:** Tim Ngwena (just-tim, https://just-tim.com/about)
- **Published:** 2020-01-27
- **Format:** Video · 15 min watch · transcript available
- **Topics:** Data prep
- **Tools:** Tableau (calculated fields, dateparse, pivot, prep)
- **Canonical:** https://just-tim.com/posts/tableau-prep-builder-pivot-transformations-part-6-of-7
- **Watch:** https://www.youtu.be/uhNQQqEHfg4

I walk through pivoting and transformations in Tableau Prep Builder, using the sample superstore flow to build a simple table with years across the top and categories down the side. I cover removing unneeded fields, converting the year to a string, the two-way pivot tool, and how aggregation can be applied directly to achieve the same result.

## Key takeaways

- The pivot tool in Tableau Prep works both ways under one icon, turning columns to rows or rows to columns, and the icon changes to show which direction you're pivoting.
- Pivoting secretly aggregates data, so you must understand the grain (row level) of your data before pivoting to avoid unexpected aggregation.
- You can extract the year as a string from a date using a calculated field with DATEPART wrapped in STR, giving the same result as an existing year field.
- The aggregation tool can replace manual field removal: anything you don't bring into the aggregation is automatically excluded, making it a faster route to the same output.
- Tableau Prep is non-destructive and flexible, letting you delete individual change steps to undo mistakes and branch flows to achieve identical results multiple ways.

## Chapters

- 0:34 Setting up the flow and pivot goal
- 2:53 Removing unneeded fields
- 5:40 Converting year to a string
- 6:23 Extracting year with a calculated field
- 7:41 Using the pivot tool
- 10:17 Achieving the same result with aggregation
- 13:06 Unpivoting data back
- 14:04 Recap and key warnings

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/tableau-prep-builder-pivot-transformations-part-6-of-7

---
just-tim — Data and analytics, with a point of view. · https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw · https://twitter.com/TableauTim · https://www.linkedin.com/in/timngwena
