pbPassingBI
/
Reshaping & aggregating intermediate 6 min

Pivot steps

Columns to rows and back, including the wildcard pivot.

What you'll be able to do
  • Pivot wide data to long
  • Pivot rows to columns
  • Use a wildcard pivot for changing columns

Columns to rows

wide product | Jan | Feb A 100 120 B 90 140 melt pivot long product | month | value A Jan 100 A Feb 120 B Jan 90 charts and groupby want long data
Most reshaping work is moving between these two forms.

Wildcard pivot

The feature that makes flows survive

Instead of naming each column, give a pattern — 2024_* or *_revenue. Any column matching it is pivoted, including ones that do not exist yet.

So when next month's file arrives with a new 2024_07 column, the flow picks it up with no edit. Without this, someone has to open the flow every month.

Rows to columns

The reverse direction turns values into column headers — one row per customer with a column per product category, for instance.

You choose the field supplying the column names and the field supplying the values, plus an aggregation for when several rows land in one cell.

Use it sparingly. It is right for a final presentation layer, and wrong for anything Tableau will analyse, since it produces one measure per value.

Which direction

SituationDirection
Spreadsheet with a column per periodColumns to rows
Preparing anything for Tableau analysisColumns to rows
Final output someone reads as a tableRows to columns
Key points
  • Rename the default Pivot Names and Values fields immediately
  • A wildcard pivot handles columns that do not exist yet
  • Tableau wants long data — columns to rows is the usual direction
Check yourself