Split row in multiple for single calculation and recombine

Hi,

I am trying to run multiple calculations for each row of my file and then recombine at the end with the calculated value. Briefly, I can do that if I use the row filter and then concatenate at the end, but I would like to do that automatically, using a loop. I think that should be quite straightforward but I found it quite challenging (I am a bit confused about the use of loop nodes) I have attached an image. Thanks for your help.

Screenshot 2022-12-04 131258

Hard to know what your specific task & goals are here, but at first glance I would think a better approach would be to do a loop end node (not variable loop end) and follow that by your writer node afterwards. That way you combine your results and then write them in a single send.

1 Like

You haven’t really provided enough details in this post.

What are the results of your workflow?
What are your expected results?
What exactly are you finding challenging?
Where are you getting confused?
What exactly would you like help with?

I don’t understand why you’re using a Table Row to Variable Loop Start node. Can you explain this choice?
If I wanted to process a table row-wise, I’d use a Chunk Loop or Window Loop.

You probably don’t need a variable connection between the Splitter and Scoring nodes. Also a Variable Loop End node (if required) should be connected to the last node in the loop, i.e. the writer node instead of the scoring node.

Can you provide the more details, along with the actual workflow and data so that we can run it ourselves?

1 Like

Apologies for not having been clear. I am using MOE nodes, which are commercial KNIME partners, which is why I have not shared the workflow. I tried to explain my problem better: the complex scoring node required only a single row for the calculation, so I need to split my multiple rows into a single “file” to run the calculation. Using the row filter I can do that manually for each row, but I would like to do that automatically for each row in my file. When I tried to use the chunk node, the outcome file was again a multiple-row file and the complex scoring node failed. Hence, which loop node I should use to split the file into multiple row, run a calculation for each of them, and then combine all the rows again into a single table? Thanks

I think I’m even more confused now than before. It’s unclear to me what the problem is.

When I tried to use the chunk node, the outcome file was again a multiple-row file and the complex scoring node failed.

What is “the outcome file”?
How did you configure the Chunk Loop Start node?
How did you construct the workflow?

Hence, which loop node I should use to split the file into multiple row, run a calculation for each of them, and then combine all the rows again into a single table?

If I wanted to process a table row by row, I’d use a Chunk Loop or Window loop with a chunk or window of 1. After all the processing, a Loop End node will do row-wise concatenation.

image

4 Likes

Hi elsamuel,

Thanks for your reply. I have done a silly mistake using the chunk loop node, I have to study the loop nodes more. it works now! Thanks for your help.

3 Likes

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