Unpivot

Reshape wide table to long (columns to rows)

What It Does

Unpivot is the opposite of Pivot. It melts several columns into two: one for the original column name, one for the value. Other columns are repeated for each unpivoted row. Useful when columns like jan_revenue, feb_revenue should be rows for charting over time.

How to Use It

Opening the Panel

Click the + button in the toolbar or press the operation picker, then search for "Unpivot". It's in the Aggregate group.

Configuration

FieldTypeRequiredDescription
Value columnsMulti-selectYesColumns whose values stack into a single column
Name columnTextYesOutput column for the source column name
Value columnTextYesOutput column for the value
SQL generated under the hood
UNPIVOT data ON jan_revenue, feb_revenue, mar_revenue INTO NAME month VALUE revenue
Try this operation →

Related Operations