on 06-12-2013 8:39 AM
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
Hi Francis,
Do you want to reset the Running Total when the Running Total itself is zero or the variable 'vararesult' is zero?
If you want to reset when the variable is zero, then add this after the else loop:
if vararesult = 0 then
RT := 0
else
RT := vararesult + RT;
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.