Math operation post joiner using column expression

Hello KNIME experts!

I have been working with KNIME analytics platform since 2 months now.
I have two tables:

  1. Has names with some scores
  2. has names with some scores

As these scores are developed on different conditions, there can be entries which are same with different scores in both tables and there can be different entries as well in any table.
If entry is present in both tables, i want to calculate the average of score, but if not, then I want to take the value as it is.
I have attached the KNIME workflow where I have achieved the same, but I am unable to filter it out to show all entries as two columns.
Currently output of table is:
image
But I want to reduce output now as below:
image

Here is what I have done till now:
Input table 1:
image
Input table 2:
image

steps used:

  1. I joined the two table as full outer join and retained all values from both tables.
  2. Replaced empty string values as NA and empty score values as 0
  3. Used column expression with below expression:
    if (column(“name”) == column(“name (#1)”)) { average(column(“score”),column(“score (#1)”))}
    else {max(column(“score”),column(“score (#1)”))}

Post this I want to reduce table to not show any values but the S1 column and respective values of name (as attached in expected output screenshot)

I have attached the KNIME workflow along with excel (they are sample as actual data is huge and confidential, so I did not attach the same)

Kindly help me out with this last step.

Thanks in Advance!
Mahima.
Attachements:
temp.knwf (13.4 KB) temp.xlsx (8.6 KB)

Hi @mahima_goyal
I think “Column Merger” can fix your problem. :thinking:
See attached workflow:
temp.knwf (14.4 KB)

5 Likes

@FtmhRahimi Thanks alot!
This works for me. I did not know about this node.
Thanks alot!

1 Like

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