Column Expressions / for loop

HI, I am new to Knime and wanted to use it to split my data (rows) in a periodic matter. For that I wanted to generate a for loop which increases the counter every time a marker condition is met and than separate with the counter. Initially I was trying to use a column expression, but it does not recognize variables and I was not able to find the syntax for the for loop. It is supposed to be written in Java, but Knime always finds errors in my variables. (example: for (int i == 0; i <= 10; i == i + 2) {i}. How can I do an increment to a counter at the marker points, or is there another way to split rows evenly? Also, where can I find the correct syntaxes for different operations in Java?

Best,
Tamas

PS: I need to split the data in more than just two sets. With periodic split I mean that every 10 counts a junk of data is cut off which is than processed separately. After the process it should be reassembled

Hi @Tamas, it sounds like the Chunk Loop Start node will do what you want.

It will split the data either chunks (defined either by # of rows or total # of chunks) and allow you to process the collection of rows in each chunk together. Close the loop with a Loop End node.

6 Likes

Thank you elsamuel! It did the job just perfectly.

3 Likes

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