Create a new column with values from data in one of two columns

Hello,

I am a Newbie to KNIME.

I have a spreadsheet I am importing into a SQL server table. I need to create a column in the import process (it doesn’t exist in the spreadsheet) to populate a field in the table.

The data in the new column needs to be determined from data in one of two columns. In my example below, I need to populate the Type column with ‘WH’ if the data in the Deal-Categ column is ‘W’, otherwise populate the new column with the value in NUO.

NUO Type Deal-Categ
NEW NEW R
NEW NEW F
NEW NEW L
USED USED R
NEW WH W
USED WH W

How do I do this in a workflow?

Thanks in advance!

Hi @mrichter and welcome to the KNIME forum,

You can use the Rule Engine node with this set of rules:

$Deal-Categ$ = "W" => "WH"
TRUE => $NUO$

:blush:

3 Likes

Hi @mrichter

For this you can use the Rule Engine node or the Column Expressions node.

The Rule Engine node might be simpler for this particular application.

I’d configure it as shown here:

1 Like

Worked perfect @armingrudd , thank you!

3 Likes

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