Creating a counter to increase under certain conditions

Hello, I would like to know if a counter can be created that can be incremented by meeting a certain condition, for example: assuming that the counter is 0, if I am > 10 then you apply the counter value, after applying this the counter will increase by 1 to your next execution

Hi @JairAlvarado , welcome to the KNIME community.

Do you mean a counter that is remembered from one execution of a workflow to the next, or just within a loop in a workflow?

1 Like

The only way that I have pulled off something like this is using a component “log file” that both reads and writes back on every execution.


If you are only counting each execute by adding 1, then you could just write the number 1 (or 0 when a condition fails) to an Excel file by appending it to the bottom of the existing table on every run. Then read it back in after and sum it using GroupBy. You could then apply formula logic afterwards. You may have to manually clean it out every once in a while depending on your use.

You would need to string flow variable connections to ensure it is reset on appropriate runs.


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.