Combine Tables

Hallo,
im a newby at Knime and have a question about combining two tables as follow.

I have two tables
Negative
Negativ

Positive
Positiv

when i use the concatenate node, then the two tables are simply added one below the other like above. What i want is something like this:

Difference= Positive - Negative

Maybe i need several nodes to do that. I need help! I am grateful for any help.

Hi!
Well, this is very simple to do:
just join the two tables using a joiner node, using Term as a key.
Then u have to rename the columns (positive and negative) and with the help of a math node, calculate the difference between values.

Hope it helps.
Luca

4 Likes

And don’t forget to use the Missing Value node to create the “0” before doing the Math.
gr hans

3 Likes

Thanks,
it helped me a lot, but

It worked well for the terms that are present in both tables.

above

But if the term does not exist in the positive table but in the negative table, the term is not displayed in the term column. Instead, there are question marks. How can I fix it?

termUnbekannt

This is the setting of the Joiner

Rename column and replacing the “?” with 0 worked very fine.

mainpage

Hi @Abdul

Did you notice the bottom right part of the second tab “Column Selection”
image
Make sure you uncheck both.
gr. Hans

2 Likes

Thank you HansS,

now it looks like


Now i will modify it to the shape i want, i showed in my first post. Thank you HansS and Luca_Italy

1 Like

Hello @Abdul,

and as a final step I suggest to use new Joiner node - Joiner (Labs) where you can chose option to Merge join columns and non matching keys will be preserved :wink:

Welcome to KNIME Community!

Br,
Ivan

3 Likes

Hi ipazin,
wow that was easy with the Joiner(Laps). Thank you ipazin. :blush:

We get this like i wanted. Perfect!

new1
new2

1 Like

wouldn’t renaming the sum column first and then concatenate and use a union of columns return the same result?
bR

Hi @Daniel_Weikert,

not really as sums from matching Terms (e.g. strategic from above picture) should be in same row :wink:

Br,
Ivan

1 Like

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