Skip to main content

Collapse Columns

Overview

Collapse Columns is the reverse of Pivot Rows to Columns. It can consolidate multiple metrics into one column for analysis and display.

For example, values such as Chinese, Math and 89, 100 can be transformed into two columns named Subject and Score.

Procedure

  1. Drag the Collapse Columns operator from the dataflow operator panel into the canvas on the right.

  2. Click the Collapse Columns operator and set the label column name and value column name.

    |400

  3. Click Add to choose the columns that should be unpivoted. Multiple columns are supported.

  4. After configuration is complete, preview the result.

Example

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.