I need to make a flow in knime that tells me at the end how many consecutive there were, for example if, yes, they are not 2 consecutive, while if, no, yes, they are not 1 consecutive, yes, yes, yes, yes, yes, no , they are not 5 consecutive is this possible?
however I am curious if it is possible to do this, I have yes yes yes, no , no, no, yes , yes, this means that only take the last two yes they were not 4 or 6 only 2
It would be more complicated but I guess it is possible. The whole thing is to find an algorithm for it that best suits the way KNIME works. As you could see, it was solved in this case using two tricks: one was to replace “No” by missing values and the other one was to count using the sum aggregation of “1” values (eq. to counting the number of Yes).
But the above cannot work in the case you mention which is more complex. I’ll have a thought about though
If the number of input columns is known, a static solution could look like this:
aggregate input columns into one column with concatenation
use n+1 rules to determine largest consecutive yes-sequence; n being the number of input columns
It works, but I’m not particularily proud of myself . A dynamic solution probably requires one of the scripting nodes. count consecutive column values.knwf (61.7 KB)