Iam posting another problem with the same report Iam working.
I have calculated avg mean distance from the fleet however now I have noticed that quite significant data returns value 0 . i don't want to include the data in average calculation which has 0 value.
I tried suppress feature & other stuff but did'nt work.
Ver 9
Database AS400
Output is
Bus No WO Date Mileage Differnce
PB9717 xxx xxxxx 156157 0
156502 345
156502 0
164164 7662
170909 6745
172168 1259
172168 0
172618 0
172510 342
Summary Count xx Avg xxx
For Calculating Average
whileprintingrecords;
numbervar summiles;
numbervar counter;
numbervar grtotmiles :=grtotmiles + summiles;
numbervar grtotcnter :=grtotcnter + counter;
if counter > 0 then summiles/counter else 0
Sum is accumulated in this formula
whileprintingrecords;
numbervar summiles;
numbervar counter;
if({FM_300L2.FMASET})= previous({FM_300L2.FMASET})then
(
summiles:=summiles +{@DIFFERNCE};
counter:=counter +1;
)
Differnce is calculated
IF {FM_300L2.FMASET} = PREVIOUS({FM_300L2.FMASET}) THEN
(
if {FM_300L2.FMPMR} >= PREVIOUS({FM_300L2.FMPMR}) then
{FM_300L2.FMPMR}- PREVIOUS({FM_300L2.FMPMR}) else
{FM_300L2.FMPMR}
)
ELSE
0
I have calculated avg mean distance from the fleet however now I have noticed that quite significant data returns value 0 . i don't want to include the data in average calculation which has 0 value.
I tried suppress feature & other stuff but did'nt work.
Ver 9
Database AS400
Output is
Bus No WO Date Mileage Differnce
PB9717 xxx xxxxx 156157 0
156502 345
156502 0
164164 7662
170909 6745
172168 1259
172168 0
172618 0
172510 342
Summary Count xx Avg xxx
For Calculating Average
whileprintingrecords;
numbervar summiles;
numbervar counter;
numbervar grtotmiles :=grtotmiles + summiles;
numbervar grtotcnter :=grtotcnter + counter;
if counter > 0 then summiles/counter else 0
Sum is accumulated in this formula
whileprintingrecords;
numbervar summiles;
numbervar counter;
if({FM_300L2.FMASET})= previous({FM_300L2.FMASET})then
(
summiles:=summiles +{@DIFFERNCE};
counter:=counter +1;
)
Differnce is calculated
IF {FM_300L2.FMASET} = PREVIOUS({FM_300L2.FMASET}) THEN
(
if {FM_300L2.FMPMR} >= PREVIOUS({FM_300L2.FMPMR}) then
{FM_300L2.FMPMR}- PREVIOUS({FM_300L2.FMPMR}) else
{FM_300L2.FMPMR}
)
ELSE
0