Title: Setting a column value based on a condition in KNIME
Post:
Hello KNIME community,
I have a question regarding setting a column value based on a condition in KNIME. I have a dataset where I want to check if the value in the $Cust. Name$ column is “ABARROTERA SANCHEZ SA DE CV”. If this condition is met, I would like to set the value in the $CADENA$ column as “SANCHEZ”.
Could you please guide me on how to achieve this using KNIME? Which nodes or configurations should I use to implement this logic?
Rule Engine - (set to replace the column CADENA at bottom)
$Cust. Name$ = “ABARROTERA SANCHEZ SA DE CV” => “SANCHEZ”
TRUE => $CADENA$
This assumes that false should remain unchanged
Column Expressions Node - (Set to replace the column CADENA at top)
If (column(“Cust. Name”)==“ABARROTERA SANCHEZ SA DE CV”) {“SANCHEZ”}
else {column(“CADENA”)}
The String Manipulation node is also commonly selected for tasks like these, but I tend to favor these 2 as they can manage tasks with various other data types as well.