split rows ... conditional output (Java row filter?)

Hey Guys… I am having a issue with the following table

Arrival ----------- Acumulated Quantity ------ --------- Maximum Capacity -------- -Compute
100 ----------------------- 400 ---------------------------------------- 550 -------------------------Yes
100 ----------------------- 500 ---------------------------------------- 550 ------------------------- Yes
100 ----------------------- 600 ---------------------------------------- 550 ------------------------- No
100 ----------------------- 700 ---------------------------------------- 550 ------------------------- No

You see that a number X of producted arrived, overtaking the maximum capacity.
But part of X could be computed if i split the rows into two like that

Arrival ----------- Acumulated Quantity ------ --------- Maximum Capacity -------- -Compute
100 ----------------------- 400 ---------------------------------------- 550 -------------------------Yes
100 ----------------------- 500 ---------------------------------------- 550 ------------------------- Yes
50 ----------------------- 550 ---------------------------------------- 550 ------------------------- Yes
50 ----------------------- 600 ---------------------------------------- 550 ------------------------- No
100 ----------------------- 700 ---------------------------------------- 550 ------------------------- No

I am not sure how to do it Tho.

Hi, please find my interpretation of your problem and the solution in the attached workflow

If a row is not “Computable” there will be a row appended, which will have the maximum capacity as quantity and which is then computable.
Z_004_append-valid.knwf (24.8 KB)

Hope this helps, greetz, Tommy

Thanks you Tommy, it gave me a better understandig… but compute and acumulated results came out wrong…

Ok, so you want to split into as many different quantities as needed? Please give a little more input.

The result is showing your table in the first post, despite sorting.

Please check this workflow and let me know if it works as expected:

breakdown.knwf (48.6 KB)

1 Like

The last three rows. it should be 650 given that distribution, right ? (despite sorting)

Hi there @taynahmayara,

so basically all you want is to split row into two when Accumulated Quantity overtakes Maximum Capacity?

Br,
Ivan

I changed the max value to test the workflow. The output is exactly what you asked for. Please check it again.

2 Likes

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