How to solve duplicate search key in cell replacer node?

Hello,

in a table I need to replace 1 cell by several cell out of the dictionary table.
For example:

Item Table Item Nr Consumption
12345 15

Dictionary table Item Nr Replacement
12345 99999
12345 88888

Should give:

Item Table Item Nr Consumption
99999 10
88888 10

A cell replacer node gives a duplicate search key error.

How can I solve this?

Many thanks in advance!!

I see there is a Typo in the request.
Consumption should be copied 1 to 1, 10 in the result table should be 15.

Hi @IvanFL

The simple answer is to ensure that you don’t have duplicate keys. If you’re using the cell replacer node, search keys must be unique.

Your example dictionary is:

Dictionary table Item Nr Replacement
12345 99999
12345 88888

Here, you have identical search keys being assigned to different replacements. You’re telling KNIME to look for 12345 in a cell and then replace it with 99999 and at the same time with 88888. This cannot work.

It’s worth exploring other approaches, but we’d need more information about the replacement strategy/logic and context.

Are there any other cells that make each row uniquely identifiable?
Is there a set number of replacements for each item number?
Have you successfully done this before in another software package?

1 Like

Hi there @IvanFL,

seems to me you are looking for Joiner node as you need not only replace but add new rows in case of match.

Br,
Ivan

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