ebstarasia
IS-IT--Management
I have a report with a Group Header which displays a date in the format of MM/YYYY. Now when the report is refreshed its asking to refresh the parameters of the date which is called T_OIM.F_PostDate. Therefore, the Group Header is based off said field/parameters.
There is a field that takes the sum of sales/volume of each month's week and displays that total number.
ie: 3/2004 1,047.75
there is a third field that takes the sum of the previous 12 months and divides that sum by 12 (Averaging the past 12 months). We are calling this field Trailing.
So the report would look something like:
Date Month Sum Year Avg/Trailing
6/2003 915.25 76
7/2003 945.00 155
8/2003 685.00 212
What I am trying to do is create a chart that plots both the Month Sum and the Trailing. However, I'm unable to chart the trailing because its not showing up as an available field in the chart expert.
here is the code that i have:
@Trailing
numberVar array Accum;
numberVar x;
numberVar y := 0;
numberVar z :=0;
if OnFirstRecord then
ReDim Accum [13]
else
ReDim Preserve Accum [UBound(Accum)+1];
Accum [UBound(Accum)] := sum({@MonthSum},{T_OIMMAIN.F_PostDate},"Monthly");
If UBound(Accum) < 13
then y := Sum(Accum) Else
(for x := (UBound(Accum)-11) to (UBound(Accum)) do
(y := (y + Accum [x]);
);
z := y/12;
)
I also have a second variation of the trailing formula
@TrailingV2
WhilePrintingRecords;
NumberVar mth1;
NumberVar mth2;
NumberVar mth3;
NumberVar mth4;
NumberVar mth5;
NumberVar mth6;
NumberVar mth7;
NumberVar mth8;
NumberVar mth9;
NumberVar mth10;
NumberVar mth11;
NumberVar mth12;
NumberVar All12months;
mth1:= mth2;
mth2:= mth3;
mth3:= mth4;
mth4:= mth5;
mth5:= mth6;
mth6:= mth7;
mth7:= mth8;
mth8:= mth9;
mth9:= mth10;
mth10:= mth11;
mth11:= mth12;
mth12:= (Sum ({@TEU}, {T_OIMMAIN.F_PostDate}, "monthly")/12);
All12months:= mth1 + mth2 + mth3 + mth4 + mth5 + mth6 + mth7 + mth8 + mth9 + mth10 + mth11 + mth12;
does anyone have any suggestions as how to chart these fields?
There is a field that takes the sum of sales/volume of each month's week and displays that total number.
ie: 3/2004 1,047.75
there is a third field that takes the sum of the previous 12 months and divides that sum by 12 (Averaging the past 12 months). We are calling this field Trailing.
So the report would look something like:
Date Month Sum Year Avg/Trailing
6/2003 915.25 76
7/2003 945.00 155
8/2003 685.00 212
What I am trying to do is create a chart that plots both the Month Sum and the Trailing. However, I'm unable to chart the trailing because its not showing up as an available field in the chart expert.
here is the code that i have:
@Trailing
numberVar array Accum;
numberVar x;
numberVar y := 0;
numberVar z :=0;
if OnFirstRecord then
ReDim Accum [13]
else
ReDim Preserve Accum [UBound(Accum)+1];
Accum [UBound(Accum)] := sum({@MonthSum},{T_OIMMAIN.F_PostDate},"Monthly");
If UBound(Accum) < 13
then y := Sum(Accum) Else
(for x := (UBound(Accum)-11) to (UBound(Accum)) do
(y := (y + Accum [x]);
);
z := y/12;
)
I also have a second variation of the trailing formula
@TrailingV2
WhilePrintingRecords;
NumberVar mth1;
NumberVar mth2;
NumberVar mth3;
NumberVar mth4;
NumberVar mth5;
NumberVar mth6;
NumberVar mth7;
NumberVar mth8;
NumberVar mth9;
NumberVar mth10;
NumberVar mth11;
NumberVar mth12;
NumberVar All12months;
mth1:= mth2;
mth2:= mth3;
mth3:= mth4;
mth4:= mth5;
mth5:= mth6;
mth6:= mth7;
mth7:= mth8;
mth8:= mth9;
mth9:= mth10;
mth10:= mth11;
mth11:= mth12;
mth12:= (Sum ({@TEU}, {T_OIMMAIN.F_PostDate}, "monthly")/12);
All12months:= mth1 + mth2 + mth3 + mth4 + mth5 + mth6 + mth7 + mth8 + mth9 + mth10 + mth11 + mth12;
does anyone have any suggestions as how to chart these fields?