1.Functional Description
1.1Purpose
This function will generate the forecast numbers for Method 2, Calculated Percent Over Last Year, if 
the processing option is set to do so.  It will also decide if this method is the Best Fit forecast
1.2Setup Notes and Prerequisites
1.3Special Logic
2.Technical Specifications
Method 2 - Simulate Calculated Percent  
 If MonthlyVsWeekly is not equal to 1
 BucketsInYr = 12
 Else
 BucketsInYr = 52
 End
 If NumberOfBuckets is less than BucketsInYr + MonthsBestFit + MonthsCalcPercent
 or MonthsBestFit + MonthsCalcPercent > 12
 Move '1' to DataError
 End Function
 End
 Subtract MonthsBestFit from LastBucketPosition to get $X
 ThisYrMinusN = 0
 LastYrMinusN = 0
 Do MonthsCalcPercent
 If ForecastAmounts is not set to '1'
 Add PtrToActualSales,$X to ThisYrMinusN
 Add PtrToActualSales,($X - BucketsInYr) to LastYrMinusN
 Else
 Add PtrToActualAmounts,$X to ThisYrMinusN
 Add PtrToActualAmounts,($X - BucketsInYr) to LastYrMinusN
 End
 Subtract 1 from $X
 End
 Divide ThisYrMinusN by LastYrMinusN to get $$CPCT
 If MeanAbsoluteDeviation is not equal to 1
 Subtract BucketsInYr from LastBucketPosition to get $X
 LastYrNMonths = 0
 Do MonthsBestFit times
 If ForecastAmounts is not set to '1'
 Add PtrToActualSales,$X to LastYrNMonths
 Else
 Add PtrToActualAmounts,$X to LastYrNMonths
 End
 Subtract 1 from $X
 EndMultiply LastYrNMonths by $$CPCT to get $$SIM
 If ForecastAmounts is not equal to 1
 Divide $$SIM by QtyBestFit to get MethodYield
 Else
 Divide $$SIM by AmtBestFit to get MethodYield
 End
 Decide if this method is the Best Fit Method
 If MethodYield is greater than 1
 Subtract 1 from MethodYield to get $SPER
 Else
 Subtract MethodYield from 1 to get $SPER
 End
 If $SPER is less than BestFit
 Move $SPER to BestFit
 Move 2  to Method
 End
 Else
 $TOT = 0
 Move LastBucketPosition to $X
 Do MonthsBestFit times
 If ForecastAmounts is not equal to 1
 Multiply PtrToActualSales,($X - BucketsInYr) by 
 $$CPCT to get $Z
 Subtract $Z from PtrToActualSales,$X to get $DIFF
 Else
 Multiply PtrToActualAmounts,($X - BucketsInYr) by 
 $$CPCT to get $Z
 Subtract $Z from PtrToActualAmounts,$X to get $DIFF
 End
 Add the absolute value of $DIFF to $TOT
 Subtract 1 from $X
 End
 Divide $TOT by MonthsBestFit to get MethodYield
 Decide if this method is the Best Fit Method
 If MethodYield is less than BestFit
 Move MethodYield to BestFit
 Move 1 to Method
 End
 End
^
D3400835 - Forecast Simulate Method 2
| Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both | 
|---|---|---|---|---|
| mnNumberOfBuckets | MATH01 | MATH_NUMERIC | NONE | NONE | 
- - - Good Performance Low Value.  | ||||
| mnQtyBestFit | MN29D9 | MATH_NUMERIC | NONE | NONE | 
This is a generic field used as a work field in Everest.  | ||||
| mnAmtBestFit | MN29D9 | MATH_NUMERIC | NONE | NONE | 
This is a generic field used as a work field in Everest.  | ||||
| cMethod | EV01 | char | NONE | NONE | 
An option that specifies the type of processing for an event.  | ||||
| cDataError | ERR | char | NONE | NONE | 
The Data Field Error Code field is simply a generic data field to pass an error condition flag.  This field is one of the fields that make up the 
  | ||||
| cForecastAmounts | EV02 | char | NONE | NONE | 
An option that specifies the type of processing for an event.  | ||||
| mnMethodYield | MN29D9 | MATH_NUMERIC | NONE | NONE | 
This is a generic field used as a work field in Everest.  | ||||
| mnBestFit | MN29D9 | MATH_NUMERIC | NONE | NONE | 
This is a generic field used as a work field in Everest.  | ||||
| mnMonthsBestFit | MATH01 | MATH_NUMERIC | NONE | NONE | 
- - - Good Performance Low Value.  | ||||
| mnMonthsCalcPercent | MATH02 | MATH_NUMERIC | NONE | NONE | 
- - - Good Performance High Value.  | ||||
| cMonthlyVsWeekly | EV01 | char | NONE | NONE | 
An option that specifies the type of processing for an event.  | ||||
| idPtrToActualValues | GENLNG | ID | NONE | NONE | 
General purpose ID variable.  | ||||
| mnLastBucketPosition | MATH03 | MATH_NUMERIC | NONE | NONE | 
- - - Bad Performance Low Value.  | ||||
| cMeanAbsoluteDeviation | EV01 | char | NONE | NONE | 
An option that specifies the type of processing for an event.  | ||||
| B3401050 Forecast Accumulate Actuals | 
| None |