Unpivot

Reshapes the data by merging one or more columns into key and value columns

Overview

The Unpivot node allows you to convert columns in your data table into row values. It involves converting wide-format data with multiple columns for different categories or attributes into long-format data, where each category or attribute is represented in a single row.

Settings

Convert to rows

Select the columns that you want to unpivot into rows. All columns' names will be stored in one column and their values in another.

Category column name

Enter a name for the new column to store the names of the unpivoted columns.

Value column name

Enter a name for the new column to store the values from the unpivoted columns.

Keep all other columns

Switch this toggle "on" to keep columns that were not unpivoted.

Example

Consider the following wide-format dataset:

CountryYearProduct_A_SalesProduct_B_SalesProduct_C_Sales

USA

2021

1000

2000

1500

UK

2021

800

1700

1200

France

2021

900

1900

1300

The result of Unpivot:

CountryYearProductSales

USA

2021

Product_A

1000

USA

2021

Product_B

2000

USA

2021

Product_C

1500

UK

2021

Product_A

800

UK

2021

Product_B

1700

UK

2021

Product_C

1200

France

2021

Product_A

900

France

2021

Product_B

1900

France

2021

Product_C

1300

Last updated