How to add columns according to conditions

Hello all.
I want to add a new “col3” column with a combination of col1 and col2.
Break when col2 is “1”, increment and combine with col1 to add col3.
Please let me know how I can help.

Hi @sima

Welcome to KNIME Forum. See this wf KNIME_project.knwf (63.5 KB)
image
First step is to identify the switch. With a GroupLoop all all A then B then … records are processed to number the “switches”.

gr. Hans

2 Likes

Hi @sima,

an other option is the use of e.g. javasnippet.


Result

BR

5 Likes

I would give group loop with moving aggregator node and string manipulation a try
br

1 Like

I was able to implement it by referring to the Workflow you provided!
It was a great learning experience.
Thank you very much.

2 Likes

I have confirmed that I can achieve this with Java Snippet.
It was a great learning experience.
Thank you very much!

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