> For the complete documentation index, see [llms.txt](https://docs.tomat.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tomat.ai/data-transformation/transforms/pivot.md).

# Pivot

Creates new columns from values in the specified columns and computes aggregation functions as values for the new columns

## Overview

The Pivot Node allows you to convert rows into columns and computes aggregate functions as values for the new columns. This transformation is particularly useful for creating cross-tabular views, making comparing and contrasting different data dimensions easier.&#x20;

The reverse operation is [Unpivot](/data-transformation/transforms/unpivot.md).

<figure><img src="https://content.gitbook.com/content/sZmcXPVeWeMtjkE1uRh9/blobs/VXUZQ64xVc8LlEyx8qNk/%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202023-08-18%20%D0%B2%2015.33.28.png" alt=""><figcaption></figcaption></figure>

## Settings

![](https://content.gitbook.com/content/sZmcXPVeWeMtjkE1uRh9/blobs/X4mIsI2YR6DhSknlgxJ2/image.png)

#### Create columns from

Select a column from which values you want to create new columns. The Pivot node will create a distinct column for each unique value in the selected column.

#### Group rows by

Select the columns you want to group by. Column order determines group hierarchy.

#### Set values to

Select columns to perform aggregation operations. You can select multiple columns for aggregation.

There are two options for creating aggregations:

1. Predefined aggregation functions. Follow these steps:
   1. Select the column you want to use as a basis for the aggregation.
   2. Choose an aggregation function from the list.
2. Custom Formula. Enable the "Custom Formula" toggle to use a custom formula. With this option, you can define any custom expression that should return an aggregation function.

#### Place values as

Applied only if more than one aggregated column was selected. Select "Columns" to create a new column for each aggregated column, and "Rows" to create new rows for the aggregations instead of columns.
