> 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/gather.md).

# Gather

Takes multiple columns and collapses into key-value pairs, duplicating all other columns as needed.

## How to Access This Feature

## From + (plus) Button

![](https://2850417076-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4HLCK3olgduYoe3RVS%2F-M4oMvCUDQwHTJ0eWi_f%2F-M4oNAcGFu7GsBeLhKxy%2Fcommand-gather-df-menu.png?generation=1586795471939787\&alt=media)

* Click "+" button and select "Gather".

### From Column Menu

![](https://2850417076-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4HLCK3olgduYoe3RVS%2F-M4oMvCUDQwHTJ0eWi_f%2F-M4oNAcRSHuaLfyrFQfP%2Fcommand-gather-column-menu.png?generation=1586795472513493\&alt=media)

* You can also select columns to gather first, and then select "Gather (Unpivot)" from the column menu of one of the selected columns.

## Gather (Unpivot) Columns into Key/Value Column Pair

![](https://2850417076-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4HLCK3olgduYoe3RVS%2F-M4oMvCUDQwHTJ0eWi_f%2F-M4oNAcWswvjTjufCIRM%2Fgather.png?generation=1586795472271301\&alt=media)

1. Select Columns to Gather

* Select "Include" or "Exclude" depending on whether you are specifying the columns to gather or the columns not to gather.
* Select the rule for specifying the columns.
* Fill the rest of parameters in "Select Column" section.

1. Specify names of Key/Value Columns to create by typing the names in "Key Column" and "Value Column" text fields.
2. Specify parameters in the "Parameters" section.

* Remove NA - Select TRUE to remove NA rows from the result
* Guess column data type - Select TRUE to automatically guess the most possible data type for the key column.

1. Click "Run" to gather columns into key/value column pair.
