Skip to Content
0
Former Member
Jun 12, 2013 at 07:39 AM

Reset Running Total

26 Views

Hi All,

I have a report contains a running total,i wrote formula for this as below,i am getting result.But i need to reset the running total when it is 0

Formula :

local numberVar vararesult;

local numbervar ads ;

local numbervar atrans;

shared numbervar RT;

if ({Command.tarAds})>=({Command.actAds}) and ({Command.tarTrans})>=({Command.actTrans})

then vararesult := {Command.tarSale}-{Command.actSale}

else (

if {Command.tarAds}>{Command.actAds} then

ads := {Command.tarAds}

else

ads := {Command.actAds};

if {Command.tarTrans}>{Command.actTrans} then

atrans :={Command.tarTrans}

else

atrans :={Command.actTrans};

vararesult := (ads *atrans)-{Command.actSale}) ;

RT := vararesult + RT;

The actual values without running total is like this.

Opp Val

2

3

4

7

5

0

0

0

After i applied running total i am getting exact result.But i need to reset it when result value(in formula) is 0.

I need like this.

Opp Val


2

5

9

16

21

21

0

0

0

Please suggest