Compare and replace values in a column

Hi Everyone,

I had a basic question regarding data manipulation in KNIME.
I need to compare and replace some values some values in a table based on specific condition.

I have a table with values :
1

I want to compare the columns to make a mapping and then replace the left column with the matching values in the same column. The output should look like:
2

Is there a node that can do this directly ? or can someone let me know the best method to do this. Thanks.

Could you please post your data so potential helpers don’t have to retype it?

1 Like

Input data is:
Input data: Input.xlsx (9.3 KB)

The required output data should be:
Output data:
Output.xlsx (9.3 KB)

Hello @Adeel_123

Here is a proposed solution using the Joiner Node to perform a matching. I also used a GroupBy Node to retain unique codes found in the first row, ensuring the corresponding codes are available for the join.

I could have also used the Value Lookup Node, but the Joiner Node allows specifying which columns to keep from both the left and right tables.

I hope this helps you.

Mapping column.knwf (88.3 KB)

5 Likes

Hi Stephane,

Thanks. It does work. Can you also point me out on how to use a vlookup node for this ?

Thanks.

@Adeel_123

Of course, this is the uptaded workflow using Value Lookup node.

Mapping column.knwf (104.5 KB)

2 Likes

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