Skip to content

Fold Multiple Columns

Description

This activity folds values from specified columns into a compact format, storing original column names as labels and their values in a separate column.

Input

Data

Output

Transformed Data

Configuration Fields

  • UseRegex Enable this option to find columns to fold using a pattern.
  • Pattern To Match Regex pattern to match columns to fold. (Rendered only when UseRegex is true)
  • Columns To Fold A list of columns to be folded into rows.
  • Folded Column The name of the new column that will store the original column names.
  • Values Column The name of the new column that will store the values from the folded columns.

Sample Input

IDNameQ1Q2Q3
1AliceYesNoYes
2BobNoYesNo

Sample Configuration

alt text

Sample Output

IDNameQuestionResponse
1AliceQ1Yes
1AliceQ2No
1AliceQ3Yes
2BobQ1No
2BobQ2Yes
2BobQ3No