Need help creating loop

Hi there,

I need help creating a workflow, Grouping by Chain ID I would like to create a sub chain based on what the flag is in that row.

The first row of the chain should become sub-chain “Chain ID-1”. Then stating in the second row if the flag is N and the prior flag is Y the sub-chain ID would be “Chain ID-1” but if the prior flag is N then the sub-chain ID would become “Chain ID-2”. Blank flags are the last row of the chain_ID

We have a similar scenario in VBA but would like it in KNIME.

image

Hi @Rugg90 Welcome to KNIME Forum

Take a look at this wf need_help_creating_loop.knwf (32.9 KB)
Does it give you the result you are expecting?


gr. Hans

1 Like

Hi there,

It seems really close to what we need. Below the left is what your output produced and the right is what we need produced. I think the blanks may be throwing it off?

Any ideas on how to correct this?

Hi @Rugg90

Can you upload this sample data set with the input columns and the output needed/expected?
It makes if much more easier to create / adjust a worklfow.
gr. Hans

2 Likes

So sorry for the delay, here is the input and output wanted.

KNIME_project2.knwf (9.3 KB)

1 Like

Hi @Rugg90

No problem with the delay (after all, it is your issue :grinning: ). But I’m very happy with some sample data. this makes it much easier to compare my solution with your desired output. I’ve now come up with a different approach, and I think it works. Maybe the wf is not 100% effective. But check it out. Curious if this is indeed a solution that you can continue with.
KNIME_project_33.knwf (95.4 KB)


gr. Hans

2 Likes

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