1.Functional Description
1.1Purpose
This function will generate the forecast numbers for Method 7, Second Order Approximation, 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 7 - Simulate 2nd Order Approximation
If NumberOfBuckets is less than (MonthsBestFit + 3 times
2ndDegreeApproxNoMonths)
Move '1 to DataError
End Function
End
Divide MonthsBestFit by 2ndDegreeApproxNoMonths to get $Y
If the remainder is greater than 0
Add 1 to $Y
Move the remainder to $R
End
Move zero to $$SIM
Move zero to $ABS
Do $Y times incrementing $Z
Multiply 2ndDegreeApproxNoMonths * ($Y - 1) to get $M
Do 2ndDegreeApproxNoMonths times
If ForecastAmounts is not set to '1'
Add PtrToActualSales,$X to Period3
Period1
Else
Add PtrToActualAmounts,$X to Period3
Add PtrToActualAmounts,($X - 2ndDegreeApproxNoMonths) to Period2
Period1
Subtract 1 from $X
Add Period3 to $$C
Add Period2 to $$B
Subtract Period1 from $$B
Subtract $$B from Period1 to get $$A
Subtract $$C from $$A
Multiply $$C by 16 to get $3
Multiply $$B by 4 to get $2
Add $2 to $$A to get Result
Add $3 to Result
If $Z is equal to $Y
If $R is not equal to 0
Divide Result by 2ndDegreeApproxNoMonths
End
Add Result to $$SIM
If MeanAbsoluteDeviation is equal to '1'
Divide $$SIM by 2ndDegreeApproxNoMonths
$X
If ForecastAmounts is not equal to '1'
Subtract $$SIM from PtrToActualSales,$X to get
$DIFF
Else
Subtract $$SIM from PtrToActualAmounts,$X to get
$DIFF
End Do
Move zero to $$SIM
End
End Do
If MeanAbsoluteDeviation is not equal to '1'
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 7 to Method
End
Else
Divide $ABS by MonthsBestFit to get Method Yield
Decide if this method is the Best Fit Method
If MethodYield is less than BestFit
Move MethodYield to BestFit
Move 7 to Method
End
End
^
D3400855 - Forecast Simulate Method 7
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 | MATH02 | MATH_NUMERIC | NONE | NONE |
- - - Good Performance High Value. | ||||
mnLastBucketPosition | MATH03 | MATH_NUMERIC | NONE | NONE |
- - - Bad Performance Low Value. | ||||
idPtrToActualValues | GENLNG | ID | NONE | NONE |
General purpose ID variable. | ||||
cMeanAbsoluteDeviation | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
mn2ndDegreeApproxNoMonths | MATH01 | MATH_NUMERIC | NONE | NONE |
- - - Good Performance Low Value. |
B3401050 Forecast Accumulate Actuals |
None |