Search code examples
reportpentahopentaho-report-designer

Pentaho Reporting get previous Field


i am using prd 5.3

i have a problem to get previous record

for example :

x | y | z | //start with 0
1 | 1 | 2 | //0 + 2
1 | 2 | 5 | //2 + (1 + 2)
4 | 4 | 13| //5 + (4 + 4)

i am using formula like this.. but i always get wrong result..

=IF([index]=0;[totalsaldoawal]+[totalamountD]-[totalamountK];[totalamountD]-[totalamountK])

this is my formula..

it means

if index = 0 // first row then [totalsaldoawal]+[totalamountD]-[totalamountK] else mustbe previous result + [totalamountD]-[totalamountK]

i tried to find some documentation like this http://forums.pentaho.com/showthread.php?49458-getting-a-column-value-from-a-previous-row but still not help me.

like this

enter image description here


Solution

  • I just using

    Summary ( running )

    this summary running will not take previous record, but i will add to the field every looping in detail's section