Icon

Unpivoting

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.

Unpivoting 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 "talland skinny." In other words, the Unpivoting node takes a table with relatively few rowsand 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 ofinclude/exclude column filter boxes. The top set of these boxes is for Value Columnsand 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 theoutput data table.- Retained Columns: These are the columns whose values will be duplicated perunique value in the selected value columns. The selected retained columns will staycolumns 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 inthe 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 columnsin the 'exclude' box for Retained Columns. We cannot think of a situation where acolumn would be included in both Value Columns and Retained Columns in the sameUnpivoting node.The output of the Unpivoting node will be a table with all retained columns pluscolumns named ColumnNames and ColumnValues. Here, we unpivoted by retaining two columns: Stateand Region. Because there are two states and thesame region values within each state, the outputtable has twice as many rows as the input table. Night Heron Data, 2023 You must be careful with what columns are selectedas value or retained columns. Here, we retainedRegion and used Population as a value column.However, because we did not retain any othercolumns, we now have no context which county orstate the population figures belong to. Retaintwo columnsInput somedataRetaintwo columns Unpivoting Table Creator Unpivoting Unpivoting 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 "talland skinny." In other words, the Unpivoting node takes a table with relatively few rowsand 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 ofinclude/exclude column filter boxes. The top set of these boxes is for Value Columnsand 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 theoutput data table.- Retained Columns: These are the columns whose values will be duplicated perunique value in the selected value columns. The selected retained columns will staycolumns 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 inthe 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 columnsin the 'exclude' box for Retained Columns. We cannot think of a situation where acolumn would be included in both Value Columns and Retained Columns in the sameUnpivoting node.The output of the Unpivoting node will be a table with all retained columns pluscolumns named ColumnNames and ColumnValues. Here, we unpivoted by retaining two columns: Stateand Region. Because there are two states and thesame region values within each state, the outputtable has twice as many rows as the input table. Night Heron Data, 2023 You must be careful with what columns are selectedas value or retained columns. Here, we retainedRegion and used Population as a value column.However, because we did not retain any othercolumns, we now have no context which county orstate the population figures belong to. Retaintwo columnsInput somedataRetaintwo columns Unpivoting Table Creator Unpivoting

Nodes

Extensions

Links