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
-
Drag the
Collapse Columnsoperator from the dataflow operator panel into the canvas on the right.
-
Click the
Collapse Columnsoperator and set the label column name and value column name.
-
Click
Addto choose the columns that should be unpivoted. Multiple columns are supported.
-
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:

-
Drag the
Unpivot Columns to Rowsoperator from the ETL operator area to the canvas on the right and connect it to the upstream node. -
Click the
Unpivot Columns to Rowsoperator. The left panel becomes the current operator configuration area. Set the label column name and value column name:- Label Column: Subject
- Value Column: Score

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

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