Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi team,
My source table is like
,
I want to add the previous row sal to current like ,
How can i achieve the above scenario
Thanks in advance
If I understand you correctly, you can do this with a tMap and tMap variables. Take a look at the screen shot below.
I have set up a variable which carries out an accumulation calculation. It is created by clicking the green + at the center top of the tMap. I used a Double (class, not primitive type....essentially I just clicked the tick box next to the "Type" column) and added the following expression....
Var.sal_accumulator==null ? row1.sal : Var.sal_accumulator + row1.sal
Since the tMap variables store values between rows, this make this calculation very easy.
Hi,
You should have a look on tMemorizeRows component.
If I understand you correctly, you can do this with a tMap and tMap variables. Take a look at the screen shot below.
I have set up a variable which carries out an accumulation calculation. It is created by clicking the green + at the center top of the tMap. I used a Double (class, not primitive type....essentially I just clicked the tick box next to the "Type" column) and added the following expression....
Var.sal_accumulator==null ? row1.sal : Var.sal_accumulator + row1.sal
Since the tMap variables store values between rows, this make this calculation very easy.
In my opinion, @rhall's solution is better but a little bit more tricky than the solution I proposed using tMemorizeRows.