Skip to main content

Unpivot Transform

Unpivot moves selected columns from a wide dataset into rows, producing long-format data. This operation is also known as melting.

Basic Usage​

To unpivot selected columns:

  1. Select Unpivot from the transform menu.
  2. In Columns to Keep, select at least one identifier column.
  3. In Columns to Unpivot, select at least one column to turn into rows.

Configure and apply an Unpivot Table transform

Configuration Options​

Basic Options​

  • Columns to Keep: Select at least one identifier column. These columns remain unchanged in the output.
  • Columns to Unpivot: Select at least one column to turn into rows. Leaving this empty does not select all remaining columns, and you cannot apply the form until you make a selection.

Output Columns​

  • variable: Holds the original names of the unpivoted columns.
  • value: Holds the corresponding values from those columns.

For nodes configured in the current app, these names are fixed. Older or API-created nodes may keep custom output names, but the current Unpivot form cannot edit them.

Examples​

Example: Unpivoting Monthly Sales Data

Input Dataset:

ProductJanFebMar
Laptop10001200900
Smartphone150016001400
Tablet500450550

Configuration:

  • Columns to Keep: Product
  • Columns to Unpivot: Jan, Feb, Mar

Result:

Productvariablevalue
LaptopJan1000
LaptopFeb1200
LaptopMar900
SmartphoneJan1500
SmartphoneFeb1600
SmartphoneMar1400
TabletJan500
TabletFeb450
TabletMar550
tip

Long format works well for time series, grouped analysis, and visualizations that expect one observation per row.

caution

Unpivoting can multiply the number of rows. Estimate the output size before applying it to a large dataset.

Best Practices​

  1. Choose Columns to Keep that clearly identify each original record.
  2. Missing values in unpivoted columns remain missing in the long result.
  3. If the selected columns contain mixed types, you may need a Convert Column Type step after unpivoting.
  4. Preview variable and value before using them downstream.