Skip to main content

Collapse Columns

Overview

Unpivot Columns to Rows is the reverse of Pivot Rows to Columns. By unpivoting columns, multiple metrics can be consolidated into a single column for analysis and display.

For example, the two rows Chinese and Math and the two values 89 and 100 can be converted into a row-based format with the columns Subject and Score.

Instructions

Steps

  1. Drag the Unpivot Columns to Rows operator from the ETL operator area to the canvas on the right.
  2. Click the Unpivot Columns to Rows operator and set the label column name and value column name.
  3. Click Add to select the columns that need to be unpivoted. Multiple columns are supported.
  4. After configuration is complete, preview the data result.

Detailed Explanation

The following example shows how to configure Student Exam Score Statistics.

Convert the table data into a new table consisting of the three columns Name - Subject - Score. Preview before conversion:

  1. Drag the Unpivot Columns to Rows operator from the ETL operator area to the canvas on the right and connect it to the upstream node.

  2. Click the Unpivot Columns to Rows operator. The left panel becomes the current operator configuration area. Set the label column name and value column name:

    • Label Column: Subject
    • Value Column: Score

  3. Click Add and select the columns that need to be unpivoted.

  4. Click Preview to preview the data result and ensure that the unpivoted result matches expectations and does not contain errors or abnormal values.

For other data processing operators used later, see Getting Started.