Skip to Content

Fold Columns

Creates new rows by combining the values of multiple columns into one.

example

dateplayer

win

loss

2022-3-1John31
2022-3-1Dave22
2022-3-2John24
2022-3-2Dave51

fold:

win

,

loss

dateplayer

fold

value

2022-3-1Johnwin3
2022-3-1Johnloss1
2022-3-1Davewin2
2022-3-1Daveloss2
2022-3-2Johnwin2
2022-3-2Johnloss4
2022-3-2Davewin5
2022-3-2Daveloss1

Configuration

Select one or more columns to fold on when configuring this transform.

Screenshot of the Fold transform configuration

Adding the Transform

  1. Select one or more columns by clicking on any column header in the table.
  2. Type fold in the filter input.
  3. Find Fold transform under Row Manipulation group.

Alternatively, you can click on + Add Script Step on the right of the wrangler to find Fold transform after expanding Row Manipulation group.

Screen recording of adding the Fold transform

Key Considerations

  • This transform replaces the original columns with new columns.
  • The default names of the two new columns are fold and value, to change them you can use the Rename Column transform.
  • Values that aren’t folded in the original row are duplicated to the new rows.