# Using the table at the start of each loop iteration which was created at the end of the previous iteration

Hi there,

Hope you are doing good.

I have a table:

M0 M1 M2 M3
a a0 a1 a2 a3
b b0

where b(n+1)=a(n)+b(n)
n=number of iterations

Currently I am using loop start node > filtering out M(n) {starting from M1} > b(n+1)=a(n)+b(n)> storing below mentioned table at the end of each node

M(n+1)
a a(n+1)
b b(n+1)

But this is giving me below result:

M0 M1 M2 M3
a a0 a1 a2 a3
b b0 a0+b0 a1 a2

Instead, I want this:

M0 M1 M2 M3
a a0 a1 a2 a3
b b0 a0+b0 a1+a0+b0 a2+a1+a0+b0

or you can say I want this:

M0 M1 M2 M3
a a0 a1 a2 a3
b b0 a0+b0 a1+b1 a2+b2

We can say that, at every start of the iteration I want loop start node to use table that I am getting at the end of previous loop end.

Rather than
Starting loop with a constant start table.

Hi @nidhichirania,the only loop you can use that allows change to the input table data with each iteration is the “Recursive loop start”. On the “recursive loop end” node, you need to pass it the new table data that is to be returned to the loop start for the next iteration.

Take a look at those specific nodes and if you have further questions please ask further and I’m sure somebody will help.

4 Likes

If possible you could provide a sample file.
Maybe it could be done with a combination of transpose - lag and moving aggregation
If @takbb s recursive loop works for you then go with that of course.
br

3 Likes

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