---
title: UnPivot columns
description: Convert selected columns into row values with a label column and a value column.
category: Data Transformation
tags: [unpivot, columns, rows, reshape, data transformation]
---

# UnPivot columns

## **Description**

The **UnPivot columns** activity converts selected columns into rows. For every selected source column, the output stores the original column name in the configured unpivoted column and the original cell value in the configured values column.

### **Supported Features**

- **Multiple column unpivoting**: Select one or more columns to convert into rows.
- **Custom label column**: Configure the column that stores the original column names.
- **Custom value column**: Configure the column that stores the original values.
- **Context retention**: Columns not selected for unpivoting are retained as row context.
- **Lineage support**: Records the unpivoted and value output column names.

---

## **Input**

| Type | Required | Description |
| --- | --- | --- |
| Data | Yes | Input rows containing columns to unpivot. |

### **Input Scenarios**

#### **1. Survey Columns**

Convert answer columns such as `Q1`, `Q2`, and `Q3` into question/response rows.

#### **2. Period Columns**

Convert month or quarter columns such as `Jan`, `Feb`, and `Mar` into period/value rows.

---

## **Output**

| Field | Type | Description |
| --- | --- | --- |
| Data | Array | Transformed rows with selected columns unpivoted into the configured label and value columns. |

---

## **Configuration Fields**

| Field Name | Type | Required | Description |
| --- | --- | --- | --- |
| Columns to unpivot | Previous Data Columns | Yes | List of source columns to convert into rows. |
| UnPivoted column | Text | Yes | Name of the output column that stores the original source column name. |
| Values column | Text | Yes | Name of the output column that stores the original cell value. |

### **Conditional Field Rendering Rules**

No conditional configuration fields are defined for this activity.

---

## **Sample Input**

| Id | Name | Q1 | Q2 | Q3 |
| --- | --- | --- | --- | --- |
| 1 | Alice | Yes | No | Yes |
| 2 | Bob | No | Yes | No |

---

## **Sample Configuration**

| Field | Value |
| --- | --- |
| Columns to unpivot | `Q1`, `Q2`, `Q3` |
| UnPivoted column | `Question` |
| Values column | `Response` |

---

## **Sample Output**

| Id | Name | Question | Response |
| --- | --- | --- | --- |
| 1 | Alice | Q1 | Yes |
| 1 | Alice | Q2 | No |
| 1 | Alice | Q3 | Yes |
| 2 | Bob | Q1 | No |
| 2 | Bob | Q2 | Yes |
| 2 | Bob | Q3 | No |
