Inside a loop, I have a table which I would like to filter based on different range-checking conditions on specific columns.
At each iteration, the number of conditions and the condition themselves are changing. They are stored in a table (which changes at every iteration)
At the moment, my solution is to have a Table Row to Variable Loop start, followed by a row filter. In the row filter, I control the column to test, the lower and the upper bound with flow variables (coming from the table shown above).
At each iteration of this inner loop, I get a filtered table which is concatenated to the one of the previous iteration.
Because I want to keep only the rows that survived every iteration, I then need to find in the table after the Loop End, which rows are present as many times as the number of iterations done.
This seems quite convoluted but I cannot find a better way to do it.
Is anyone able to help me?
Ideally I need a recursive loop, and pass back to the loop start the treated table. In such a way, I would already find the final table at the Loop End.
So just to check my understanding, you have a dynamic set of conditions held as rows in one table (in the form you’ve shown in the screenshot) and you want to find all the rows in another table that meet ALL of those conditions ?
Assuming the above is right, then yes, if you were going to do a loop it would probably have to be a recursive loop so it filtered out rows on each iteration, but using a loop seems overkill here.
My immediate thought is that you are effectively trying to re-invent the Rule Based Row Filter which would achieve what you are trying to do, albeit using the set of rules defined in the node’s config instead of from a table.
OK, so you want it to be dynamic with thresholds specified in a table. I get that, so why not just build the rules from the table and feed that to the Rule Based Row Filter…
If you still need to process in a loop (e.g. as you say you have varying conditions with each iteration) could you upload a sample demo, as I can’t quite picture how that works. I’d imagine that even with some loop processing, the above construct with the Rule Based Row Filter might still be able to simplify things for you.
What I cannot understand is that if you want to retain only the rows that meet all the rules, and the rules change on each iteration, then surely just applying all the rules in one go without iterating achieves the same effect, so maybe I’m misinterpreting what you said.
edit:
And then… there’s the Rule-based Row Filter (dictionary) which I have never actually used, but appear to have just re-invented