Spread

<< Click to Display Table of Contents >>

Navigation:  Reference > Transforms >

Spread

Description

Spread a column into multiple new columns. Also called wide pivot or crosstab.

 

Example

 

gather-long-pivot-example-3

 

With Quarter and Amount columns spread:

 

spread example

 

Gives:

 

spread example

 

Inputs

One.

 

Options

Select the Key column and Value column you wish to spread.

Missing values is used for values missing from the input dataset.

set Min. new cols to the minimum number of new columns you wish to add.

set Max. new cols to the maximum number of new columns you wish to add (ignored if less than minimum).

 

Notes

If there are rows that are duplicates, apart from the value column, this will cause errors.

New columns are added at the right end. You can change the column order with Reorder Cols.

You can merge the new columns into a single column with Concat Cols.

The opposite of Spread is Gather.