I am trying to implement some simple if/then logic in the mapping expression of a filter node in an SDI flowgraph. I keep running into syntax errors, and can't seem to find any documentation on whether this is even possible.
The expression I feel like should work takes the following form:
IF( "x"=1, 10, 100)
Where "x" represents an input field to the filter node. However, when I try this I get an internal error saying the SQL expression cannot be converted to a CS expression.
Is if/then logic possible in a Filter node? I tried CASE, and got a similar error. Can somebody point to some documentation for one of these functions if it is possible?
Thanks,
Anthony
Hi Anthony,
the following expression should work for your example.
CASE WHEN "x" = 1 THEN 10 ELSE 100 END
To extend it you can also specify another WHEN <condition> THEN <output> block before the ELSE block.
Best Regards,
Timo Wagner