CELL REPLACER

Hello,

I have these tables

I want to replace old ITEMS in table 1 with new ITEMS of table 2 and will create the output table. I 'm currently using the cell replacer node but it didn’t return the new ITEMS from column 2. Any suggestions what nodes i can use for this. Thank you!

Hi @melvinp .

You can use node String Replacer.

Br

1 Like

Hi @hmfa,

is there other node i can use because i don’t have a string replacer (dictionary) on my repository.
I only have these two.

sample data

Thank you!

Hello @melvinp

I have created a work flow for you. I have set it up to make is as easy as possible to update and change.

An explanation

The input table is the input table and it goes straight into the Rule engine node.

The dictionary table is also as you had it, but this connects to a column expressions node. The node makes the rules to apply. You can add or remove any number of lines in this dictionary and it will dynamically still make the rules.

The default rule table, this holds the end default rule for the rule engine.

A side note: I really don’t like that I have had to use another table creator and concatenate to get the final rule in the rule list. Is there another better way?

Frank

3 Likes

Sorry @melvinp.

This node is available for KNIME Analytics Platform version 5.1.0 or higher.
Can you upgrade do 5.2?

Br

@hmfa, hmm maybe i can upgrade to a higher version but i still have to contact out transformation team to seek an approval to upgrade. Are there any nodes i can use aside from the string replacer (dictionary) or any node i can use that are available in version 4.6.2. Thank you!

@FrankColumbo, may i know what’s in the default rule table? I’m just having two table as input tables. Thank you!

Hi @melvinp.

Sorry to ear that.
You can follow @FrankColumbo aproach. It acheaves the same results and can be used with several different rules at the same time.

Br.

1 Like

Hi @melvinp

Sure.

I dont know what you know or dont know - so if i am teaching you to suck eggs - sorry.

The rule engine takes rules and applies them, in this case: $A$ = “3” => “F” and $A$ = “5” => “G”. If the rules dont apply you will end up with a missing value:
image
unless you use a default rule: TRUE => $B$.
image

This is hard coded in to the flow because I havent worked out a more elegant way. (see bottom of my last answer).

Frank

1 Like

Hi @melvinp
I made this one for you.

Have a try.


CELL REPLACER.knwf (79.4 KB)

Br

1 Like

So thankful for your help @FrankColumbo @hmfa :slight_smile:
I really appreciate it!

@melvinp

you can design a workflow without using the “Table Manipulator” node

Screenshot 2024-02-15 144205

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