Move the content of a column to an existing row

Dear KNIMErs,

do you know this feeling when you think “I have done this before, but how does it work again?”…

I have that now with the following challenge:

I have a table resulting of a GroupBy Node and now want to have the column content added to the same row, as this is somehow how the - already existing - results spreadsheet (Excel) is set up since ages.

This is what I mean.

Here’s my input table:

image

The result spreadhseet (should) look(s) like this:

I have tried with Transpose and Unpivot Nodes but somehow couldn’t quite get there. Also tried the Lag Column Node but it somehow skipped some content.

I have shared the input workflow over at the KNIME Hub - it also included the results table as a spreadsheet file in the KNIME workflow’s data area (shared with the wf).

Thanks in advance!

Hi @kowisoft

A new great challenge !

What makes one to straggle here is that amazingly, the operation needed is a combination of unpivoting and transposing. It is not as obvious as it seems :wink:

I have implemented the following solution:

Move column content to row (a possible solution).knwf (43.8 KB)

Hope it helps :wink:

Best
Ael

6 Likes

Hi @kowisoft

This wasn’t straight forward at all indeed.
Here another possible solution
Move column content to row (another possible solution).knwf (78.1 KB)


gr. Hans

7 Likes

Thanks a lot @aworker . Indeed, it felt like the direction was right but I didn’t think of combining both of the nodes.

Thank you @HansS - Great solution.

Unfortunately I cannot click both as solution :wink: I owe both of you a beer at the next KNIME Summit (hoping that it will be in person again)

5 Likes

Hello @kowisoft,

not a heavy Excel user but shouldn’t there be an easier solution to this by using Excel? This looks awfully wrong…

Br,
Ivan

Thanks for your insights @ipazin

The situation we’re faced with is this: We want to use KNIME to automate the nasty formula copy & paste stuff. So what is a Table Creator Node in this very example is the result of a bigger workflow in a real world use case (can’t share due to restrictive information). This question was more geared towards the question “how do we get this back into Excel?”

Why “back to Excel”? The thing is, we currently cannot force them into using KNIME but instead automate with “what we have”, hence the spreadsheet they need to use.

If we combine this with the Excel Cell Updater Node, we would basically have an end-to-end ETL / spreadsheet automation workflow.

1 Like

I understand that @kowisoft. Don’t have an issue with getting data back to Excel file and having work automated. Just saying that using KNIME to prepare Excel format (not data!) is cumbersome and there should be an easier way if there’s no one.
Ivan

2 Likes

@kowisoft sorry for my late reply. It will be a great pleasure for me to meet at the next KNIME summit around a nice beer :grinning: :+1: !

Thanks @kowisoft for all your contributions and nice posts. I really enjoy them !
Cheers
Ael

2 Likes

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