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

# Pivot

Pivot columns into rows and columns. Values are count of pairs of rows and columns or aggregation of another column.

## How to Access This Feature

![](/files/-M4oNCewtH11gOQodqjl)

* Click "+" button and select "Pivot"

### From Column Menu

![](/files/-M4oNCf-zdufbXHGTPOF)

* You can also select "Pivot" from column menu of the column you want to pivot.

## Pivot

![](/files/-M4oNCf1eRakPUxtTfNJ)

1. `Rows` - select columns for Pivot Row.
2. `Columns` - select colums for Pivot Columns.
3. `Value` (Optional) - A column for values in output data frame.

### Parameters

* Remove NA - The default is TRUE. If NA should be removed from value.
* Fill NA with - The default is 0. This is what should be used for missing value in groups.

**Example**

*Original data:*

| clarity | certification | colour | price |
| ------- | ------------- | ------ | ----- |
| VVS2    | HRD           | F      | 10796 |
| VS1     | GIA           | F      | 1551  |
| VS1     | GIA           | F      | 4291  |
| VVS2    | GIA           | F      | 5881  |
| VS2     | GIA           | H      | 4585  |
| VVS2    | GIA           | H      | 5193  |

if you set **row**: clarify, colour **columns**: certification **value**: price **fill**:0

\
\&#xNAN;*it returns data frame with rows of combinations of clarity and colour and with columns of certification. Values are sum of price and missing values are filled by 0.*

| clarity\_colour | GIA  | HRD   |
| --------------- | ---- | ----- |
| VS1\_F          | 5842 | 0     |
| VS2\_H          | 4585 | 0     |
| VVS2\_F         | 5881 | 10796 |
| VVS2\_H         | 5193 | 0     |
