Populating a column based on another column.

Here's a KNIME related challenge I'm currently facing: I have a Column titled "Description," and the data is string. I also have another column that lists the Brand. My Brand column is not fully populated and has blank cells, but in these cases by reading the Description I can figure out the brand. I would like KNIME to read the description column and populate the Brand column whenever it is blank.

Here are a few examples:

Description:  46oz NEUT cream
Brand: <Blank>
Result: KNIME notices "NEUT" and populates "Neutrogena" in the Brand Column.

Description:  Case of BUD product
Brand: <Blank>
Result: KNIME notices "BUD" and populates "Budweiser" in the Brand Column.

I'd really like to use a dictionary-like function since I have a few dozen of these rules. The String Replace Dictionary only works when the whole cell matches the dictionary, but in my case I need it to find characters within the string, find the equivalent value in the dictionary, then populate the brand column.

Any Ideas? Thanks in Advance!

Hi,

See the worklow in attachment.

Hi Fabien!

Thank you very much for your quick reply and the excellent example! Do you know if there's a way to incorporate a dictionary into a Rule engine? The reason I ask is because the rule engine requires me to code one line per attribute, and so the dictionary would be much more easy to maintain (I have a lot of these rules). 

If it makes things simpler, I wouldn't care if the "Brand" Column got overwritten, or if the output was placed on a new column.

Hi,

here's an idea: you can manipulate your replacement table, too. For example, you can create regular expressions and then use a String Replacer (Dictionary). You could also create a rule-set as a string and load that into the Rule Engine, but why make it so complicated?

A dictionary is not going to work for a limited selection, and only applicable for the whole word.? new thing for me to discuss.

http://onlinepokies.me/

Hi,

Definitively, the dictionnary will work only with the whole word. But I don't see the point, doing a dictionnary with all the entries or copy paste a file text of rules within the rule engine is exactely the same thing only using the rule engine seems to me easier.

Best regards,

Fabien