I am new to knime and try to migrate workflows from SPSS Modeler to KNIME. I stuck on applying a derived field:
How can I derive (create) a new variable by using if then else with multiple conditions on existing columns? Which nodes are best for the following example?
if (var1 > 0 and var2 > 0) or (var3 + var4 > 0) then 1 else 0 endif
I tried different nodes (column expression, rule engine, math formula) but wasn’t able to make it work.
For simple comparison rules you can use Rule Engine node. It will not allow you to sum up something, however - so you need to do your calculations prior to rule engine using Math node.
Thank you very much to all of you for your answers and hints and links. After that I think it’s best to go with the rule engine. I can rewrite my logic though I was interested how such a simple comparison could be done 1:1 in KNIME.