Jump to content
We've recently updated our Privacy Statement, available here ×

Get previous row/value/variable within detail section


b.eurika84

Recommended Posts

I have the query result like this

TransactionDate Amount Debit/Credit StartingBalanceToday-------------------------------------------------------------------------2013-03-01 1000 C 1000 2013-03-01 100 D 1000 2013-03-01 200 D 1000

 

then i want to add new column "Balance" in the report like this

 

TransactionDate Amount Debit/Credit StartingBalanceToday Balance-------------------------------------------------------------------------------------2013-03-01 1000 C 1000 2000 2013-03-01 100 D 1000 19002013-03-01 200 D 1000 1700

"Debit/Credit" column determines whether the calculation is ADD or SUBSTRACT.

If "Debit/Credit" is "C" then the calculation is ADD, otherwise "Debit/Credit" is "D" then the calculation is SUBSTRACT

the formula for new column "Balance" -----> Balance = StartingBalanceToday -/+ Amount

then for the next "Balance" -----> Balance = Previous Balance -/+ Amount

nb: Previous Balance is the value of previous "Balance"how can I solve this problem? I have tried to use variable BALANCE to store the formula Balance = Previous Balance -/+ Amountbut I dont know how to acces the previous variablePlease help :)Thanks

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...