Extract Text

Hi Everyone,

I am still pretty new to knime and was wondering if I could get some help figuring out if I can do the following:

Current Data

Key | Part Number | Amount
AAA02 | 33 | $20
AAA55 | 40 | $30
BB629 | 12 | $55

Desired Outcome

Key | Store | Part Number | Amount
AAA02 | C | 33 | $20
AAA55 | C | 40 | $30
BB629 | A | 12 | $55

Essentially, I want to set rules to look at the “Key” column and find criteria within a cell to let me know what store location the Part was purchased. In reference to the example above, AAA = Store C and BB = Store A.

1 Like

Rule Engine node has to work for you.

6 Likes

Hello @AColvin6,

Altought the answer of @izaychik63 works well, but i would rather use a dictionnary and a joiner node.
In fact, with the Rule Engine, you would have to code every rule for every store. But by using a dictionnary like a simple Excel File that can be updated later (even by others person if needed) by adding new store i.e new rules.

Then you extract the first 2 or 3 char of the key and join with the dictionnary to add the “Store” column :

Br,

Samir

5 Likes

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