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
ID | Name | Q1 | Q2 | Q3 |
---|---|---|---|---|
1 | Alice | Yes | No | Yes |
2 | Bob | No | Yes | No |
Sample Configuration
Sample Output
ID | Name | Question | Response |
---|---|---|---|
1 | Alice | Q1 | Yes |
1 | Alice | Q2 | No |
1 | Alice | Q3 | Yes |
2 | Bob | Q1 | No |
2 | Bob | Q2 | Yes |
2 | Bob | Q3 | No |