Restructuring the shape of a data table is an important part of many KNIME workflows. The Unpivoting node allows us to convert a "short and wide" table into one that is "tall and skinny." In other words, the Unpivoting node takes a table with relatively few rows and many columns and creates one with relatively many rowss and few columns.
The configuration menu for the Unpivoting node is simple. There are two sets of include/exclude column filter boxes. The top set of these boxes is for Value Columns and the bottom set is for Retained Columns.
- Value Columns: These are the columns whose values you want to unpivot into rows. Every unique value within the included value columns will become a new row in the output data table.
- Retained Columns: These are the columns whose values will be duplicated per unique value in the selected value columns. The selected retained columns will stay columns in the output data table.
It is very important to pay attention to the 'enforce inclusion' and 'enforce exclusion' options for both Value Columns and Retained Columns. Having columns selected in the wrong box with the Unpivoting node will certainly result in inaccurate results.
Generally, the columns in the 'include' box for Value Columns will be the same columns in the 'exclude' box for Retained Columns. We cannot think of a situation where a column would be included in both Value Columns and Retained Columns in the same Unpivoting node.
The output of the Unpivoting node will be a table with all retained columns plus columns named ColumnNames and ColumnValues.
Workflow
Unpivoting
Used extensions & nodes
Created with KNIME Analytics Platform version 4.7.2
- Go to item
- Go to item
Legal
By using or downloading the workflow, you agree to our terms and conditions.