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.
To use this workflow in KNIME, download it from the below URL and open it in KNIME:
Download WorkflowDeploy, schedule, execute, and monitor your KNIME workflows locally, in the cloud or on-premises – with our brand new NodePit Runner.
Try NodePit Runner!Do you have feedback, questions, comments about NodePit, want to support this platform, or want your own nodes or workflows listed here as well? Do you think, the search results could be improved or something is missing? Then please get in touch! Alternatively, you can send us an email to mail@nodepit.com.
Please note that this is only about NodePit. We do not provide general support for KNIME — please use the KNIME forums instead.