I have one more question this is a report I walked into and it took me long enough to figure out the report logic that was written. What it does now is take 4 week forcast from this long field converts it then figures out the current week (based off current month) steps foward that many places and grabs the next 4 numbers add's them up and divides them for avg. This is now working fine with a few tweeks.
but now they want 13 weeks (then divided by 3 for a monthly avg) and before end of year not having data was o.k. now its not. we have a field that holds the year only and a field that has the long values (keyed off the year)
any idea how to roll the 2 together?
in CommaDelimitedForecast
Replace ({fcs_sum.fcs_pr_fcst},';',',') + ','
in ForecastArray
Global numberVar array Forecast;
numberVar ArraySize := 52;
numberVar i := 1;
numberVar j := 1;
numberVar k := 1;
ReDim Forecast[ArraySize];
for i := 1 to ArraySize do
(
k := InStr (j,{@CommaDelimitedForecast},",");
Forecast := ToNumber(Mid ({@CommaDelimitedForecast},j,k-j));
j := k + 1
);
0
in ForecastWeekNumber
DateDiff ("w",Date (Year (CurrentDate),1,1),CurrentDate)+1
in ForecastYear
ToNumber(Year(CurrentDate))
in FourWeekForecast
WhileReadingRecords;
Global numberVar array Forecast;
ReDim Preserve Forecast[52];
Forecast[{@ForecastWeekNumber}]+
Forecast[{@ForecastWeekNumber}+1]+
Forecast[{@ForecastWeekNumber}+2]+
Forecast[{@ForecastWeekNumber}+3]
in SharedForecast
whileprintingrecords;
shared numbervar fcst := {@FourWeekForecast}
but now they want 13 weeks (then divided by 3 for a monthly avg) and before end of year not having data was o.k. now its not. we have a field that holds the year only and a field that has the long values (keyed off the year)
any idea how to roll the 2 together?
in CommaDelimitedForecast
Replace ({fcs_sum.fcs_pr_fcst},';',',') + ','
in ForecastArray
Global numberVar array Forecast;
numberVar ArraySize := 52;
numberVar i := 1;
numberVar j := 1;
numberVar k := 1;
ReDim Forecast[ArraySize];
for i := 1 to ArraySize do
(
k := InStr (j,{@CommaDelimitedForecast},",");
Forecast := ToNumber(Mid ({@CommaDelimitedForecast},j,k-j));
j := k + 1
);
0
in ForecastWeekNumber
DateDiff ("w",Date (Year (CurrentDate),1,1),CurrentDate)+1
in ForecastYear
ToNumber(Year(CurrentDate))
in FourWeekForecast
WhileReadingRecords;
Global numberVar array Forecast;
ReDim Preserve Forecast[52];
Forecast[{@ForecastWeekNumber}]+
Forecast[{@ForecastWeekNumber}+1]+
Forecast[{@ForecastWeekNumber}+2]+
Forecast[{@ForecastWeekNumber}+3]
in SharedForecast
whileprintingrecords;
shared numbervar fcst := {@FourWeekForecast}