snat
October 14, 2019, 3:44pm
1
Hello forum!
I am quite new to knime, and I need your help.
I am trying to transform a matrix like this one:
And I want to obtain a list like below:
C1 - R1 - 1
C1 - R2 - 1
C1 - R3 -
C1 - R4 - 5
C2 - R1 - 0
C2 - R2 - 1
âŚ
And so on.
I have checked forum and I havenât found anything similar. I apologize if it is a âsillyâ question or if it has been already answered.
Thanks in advance.
Best regards,
HansS
October 14, 2019, 4:49pm
2
Hi @snat
Welcome to the KNIME forum. Good you ask this! There are no silly questions. See this workflow matrix_to_single_row.knwf (24.3 KB)
If any question feel free to ask.
gr. Hans
4 Likes
Hi @snat and welcome to the KNIME community forum,
The Unpivoting node is what you are looking for.
P.S. I agree with @HansS , âthere are no silly questionsâ. Here, we are all learning from each other.
4 Likes
snat
October 15, 2019, 10:14am
4
Thank you very much to both of you for your quick response!
I tried with unpivoting before asking to the forum, but I didnât succeed, so I have followed Hansâ suggestion. I just need to add the combination of columns/rows name/header to the values, but I can manage it by myself
Best regards!
2 Likes
You have to include all the columns as the âValue columnsâ and exclude them from âRetained columnsâ:
Then if you sort the table by âColumnNamesâ this would be the output:
3 Likes
snat
October 15, 2019, 10:50am
6
Thanks again @armingrudd !
With your screenshots and playing a little bit with settings of file reader (for reading row ID/column header) I have managed to get something very close to what I need.
Now I know how to do that in 2 different ways
Best regards,
4 Likes
system
Closed
October 22, 2019, 10:50am
7
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.