Transform rows into new columns based on some conditions

Good day , i am pretty new in knime ,
But i have to do the following thing and I am pretty stuck.
So i have one table which contains a number of columns and rows:
like :

The task is to:
remove some rows , which i have done like the 4th(89.349.017) row and the 5th( blank one) , they are not needed
So now I have a table with rows starting from “locked”, “only for”, ,“2023”, “Buget 2023” and “71.052”
the task is that for each column with the rows above i need to create one column more with the values in total 5 column instead of 1 that is already existing
How can i take a row and transform it into a column ? and do this for each of the columns that i already have
output should be like so:

Hope i made a clear picture of the task

Welcome to KNIME!

You are looking for the UnPivoting node. If you need to dynamically select column names because they change on different documents, then you will need to select them logically and then pass those to the Pivoting node via flow variable.

If you don’t need to actually pivot the data to keep everything logically associated, then you can split your columns using the column splitter - transform the ones that need to move to rows - then append back the ones that are for reference only.

I had to make a lot of assumptions here since I don’t know how things actually look in KNIME. It could be as simple as setting the excel reader to place those column names, then doing some column filtering and some simple manipulation to dial it in… You can also upload a document with dummy data if you need more help.

1 Like

Hi @cornel_sarbu ,

If you use the Excel reader node, you can set the start column and row from the first tab.

With it, you can remove lines and columns that you don’t want.

The result will be the first line as a future header that you can use the Row to column Header to transform your table with the final result.



I hope thats helped you.




This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.