is there a possibility do duplicate a row or rather multiply by a specific number from the table?
For example i have a table like this:
In the end it should look like this:
so the row should be duplicated as often as the factor in Col2 indicates and if Col2 is for example LIKE 2 there should be the same Row for 2 times.
It is important that the 2 should then be divided by itself in the output table. (Col2 must always be 1)
The Chunk Loop Start iterates the input rows one-by-one. Then I extract the “number of repetitions” using a flow variable in the Table Row to Variable which is fed into the second Counting Loop Start node. Both loops need to be terminated using a Loop End node.
At the end, I replace all column2 values with a constant of 1 using the Rule Engine:
Forgot to say that my input table is a bit more complicated. It looks like this
In the end it should look like this:
So all rows of Col2 should be divided by the first number (in red: 1,3,2) if Col1 stays the same. So the rows with x’s remain because they will be divided by one. The lines with Y are divided by 3, so from the previous 3 lines a total of 9 lines.
A bit hard to explain but I hope you can understand.
for this case you’ll most definitely need some nested loops. I suggest you have a look at the WF which I posted and see how this can be adapted to your case.
Beside the Loop nodes which I already used, I’d recommend to have a look at the Group Loop Start node.
possibly this workflow do the same without looping. The only assumption is, that your data are in the correct order and the multiplication of the rows is performed on the first row for each unique entry in Col1 (group condition).