Loop Problem with nested(?) loops

hello fellow Knimers,

I am desperate … I have no problem with (nested) loops in plain code writing, but KNIME’s graphic representation (while helpful in other areas and I love it!) completely puzzles me when it comes to construction loops. I just cannot get to grips with the logic of it.

here’s the problem: I have a table with IDs in one column, and formulas in another column (this can be empty). I need to check for each row (ID) if it is dependent on another ID(s), that means: if it has a formula attached, is this formula referencing any ID(s) of the ID column.

| A | B     | C                                                                            | D             |
| 1 | 12276 | ?                                                                            |               |
| 2 | 12277 | if( exact( value(12276), ‘N/A’ ), value(12278), value(12276) )               | [12276;12278] |
| 3 | 12278 | ?                                                                            |               |
| 4 | 12279 | { AttribID:=12275} if( exact( value(AttribID, ‘N/A’ ), ‘’, value(AttribID) ) |               |

here, ID 12277 (row 2) would be dependent on ID 12276 (row 1) and ID 12278 (row 3) and as the goal, I would like to add a column with the dependencies (as a list like in Column D, or similar).

I extracted the ID-column as a separate table and tried to chunk loop through every row of the main table to look at one formula at a time.

Then try to “side-inject” the extracted ID table to iterate through all IDs to test if they occur in this single formula from the main loop.

nesting two for-loops in code is straightforward, but I just can’t make it in KNIME ??? :sob:

PS: if anyone knows a good primer for KNIME loops, please share. the KNIME flow control documentation didn’t clarify this for me…