Skip to main content

Pivot Rows to Columns

1. Overview

Supports converting row dimensions of a data table into column dimensions.

For example, convert accessory rows into columns, with sales amount as the fill data.

image.png

2. Usage Instructions

2.1. Operation Steps

  1. Drag the Pivot Rows to Columns operator from the ETL operator area to the right canvas editing area;
  2. Click the Pivot Rows to Columns operator, select the column to pivot, the new column fill data, and the aggregation type;
  3. Click Add, select the primary key column, and enter the new column name;
  4. After configuration, preview the data result.

image.png

2.2. Detailed Description

Below is an example of configuring Inventory and Sales Analysis.

Convert the category column into rows, with sales amount as the fill data. Preview before conversion:

image.png

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

  2. Click the Pivot Rows to Columns operator, the left area becomes the current operator configuration area. Select the column to pivot, the new column fill data, and the aggregation type.

  • Column to pivot: Category
  • Fill data for new column: Sales Amount
  • Aggregation type: Sum

image.png

  1. Click Add, select the primary key column, and enter the new column name.

Note: The primary key column determines which primary key the output dataset will be based on. When multiple primary key columns are selected, a primary key set is formed, and the output dataset is based on this set.

  • Primary key column: Month
  • New column names: Shoes, Accessories, Clothing

image.png

  1. Click Preview to preview the data result and ensure the pivoted data meets expectations and contains no errors or anomalies.

image.png

For subsequent use of other data processing operators, see Getting Started.