I am trying to do a simple if-then calculation such as:
IF [Column A] = 4 THEN [Column B] * -1
ELSE [Column A]
I want to take a price column and make it negative for returns. I have looked at the Rule Engine, Column Expressions, Java Snippet, Column Lag, and other nodes, but it is still not clear how to make this simple calculation. Can some please offer any suggestions? Thank you.
Thank you, that worked! Can you tell me of any resources to learn more about the Column Expressions node? I canβt find many examples of the syntax used. Thank you.
there is plenty material to learn more about Column Expressions node. First to mention that node uses JavaScript language so you can check this page to learn more about syntax you need.
Also this video by KNIME gives you node introduction and this blog post by @armingrudd presents a use case with example code with screen shots
Thank you for sharing these resources! After reading @armingruddβs blog post, I can see how powerful the Column Expressions node is! Now, I need to learn a little javascript!