and i want to do the following:
check column by column from “subcutaneous” onwards if the value for the subcutaneous row is > 0
if it is > 0 the value shall be replaced with the value in the Count(Drug ID Number) column.
I do however not know what columns (formulations) i might have in a set and therefore hard coding all formulations (subcut., systemic ,…) in rule engine nodes will be a problem as the rule engine node would fail if the column isn’t existing.
if I got it right you don’t need a loop nor Rule Engine node cause you can do it with one node in Math Formula (Multi Column). Use if() function, CURRENT_COLUMN placeholder with option to Replace Selected Columns. This expression should do it:
if($$CURRENT_COLUMN$$ > 0, $CountColumn$, 0)
Just make sure your count column is numeric in order to be available in Math Formula node(s). (Use String To Number node.)
As to why current setup is not working. You can not reference column values in Rule Engine with flow variable holding column name. See here for more and possible workarounds:
that is indeed a straight forward and really elegant way to do it.
just tried it and it works really well.
many thanks for this and also for the fast reply, highly appreciate it