References → Unpivot Recipe
Unpivot is a tool that can transpose rows from an input dataset into columns. The output of an unpivot tool will be the number of fixed columns with the addition of two more columns - one with the remaining column names and the other with column values. This can be especially useful when working with data where columns are date-based and require aggregation.
Configuration
Configuration | Description |
---|---|
Recipe Name | A freeform name of how a user would like to name a recipe |
Input | Select a previously constructed recipe to process |
Fixed Column(s) | Select the column that should not be affected by the unpivot |
Column Headers Unpivoted Name | Select the name for the column containing all the column header values |
Column Values Unpivoted Name | Select the name for the column containing all the column data values |
Note
Please note that all unpivoted columns must share the same data type category (e.g. all strings, or all numeric). If errors occur during the unpivot, use a select column tool to remove columns with the inconsistent data type.
Sample
Input Data:
Year | Jan | Feb | March |
---|---|---|---|
2024 | 5651 | 6731 | 5453 |
2023 | 1463 | 3892 | 7747 |
2022 | 1232 | 1221 | 2232 |
Configuration:
Fixed column: Year
Column Headers Unpivoted Name: Month
Column Headers Unpivoted Name: Value
Output Data:
Year | Name | Value |
---|---|---|
2024 | Jan | 5651 |
2024 | Feb | 6731 |
2024 | March | 5453 |
2023 | Jan | 1463 |
2023 | Feb | 3892 |
2023 | March | 7747 |
2022 | Jan | 1232 |
2022 | Feb | 1221 |
2022 | March | 2232 |