ForecastSimulateMethod5

Forecast Simulate Method 5

Major Business Rule

Object Name: B3400850

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose
This function will generate the forecast numbers for Method 5, Linear 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 5 - Simulate Linear Approximation
If NumberOfBuckets is less than (MonthsBestFit + LinearApproxNoMonths)

Move '1' to DataError

End Function

Else

Subtract MonthsBestFit from LastBucketPostion to get $X

$TOT = 0

Do MonthsBestFit times

Subtract (LinearApproxNoMonths - 1) from $X to get $Y

If ForecastAmounts is not equal to '1'

Subtract PntrActualSales,$Y from PntrActualSales,$X to get 

$$SIM

Divide $$SIM by (LinearApproxNoMonths - 1)

Add PntrActualSales,$X to $$SIM

Else

Subtract PntrActualAmount,$Y from PntrActualAmount,$X to get 

$$SIM

Divide $$SIM by (LinearApproxNoMonths - 1)

Add PntrActualAmount,$X to $$SIM

End

Add 1 to $X

If MeanAbsoluteDeviation is not equal to '1'

Add $$SIM to $TOT

Else

If ForecastAmounts is not equal to '1'

Subtract PntrActualSales,$X from $$SIM to get $DIFF

Else

Subtract PntrActualAmount,$X from $$SIM to get $DIFF

End

Add the absolute value of $DIFF to $TOT

End

End

If MeanAbsoluteDeviation is not equal to '1'

If ForecastAmounts is not equal to '1'

Divide $TOT by QtyBestFit to get MethodYield

Else

Divide $TOT 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 5 to Method

End

Else

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 5 to Method

End

End

End


^

Data Structure

D3400850 - Forecast Simulate Method 5

Parameter NameData ItemData TypeReq/OptI/O/Both
mnNumberOfBucketsMATH01MATH_NUMERICNONENONE

- - - Good Performance Low Value. 

mnQtyBestFitMN29D9MATH_NUMERICNONENONE

This is a generic field used as a work field in Everest.

mnAmtBestFitMN29D9MATH_NUMERICNONENONE

This is a generic field used as a work field in Everest.

cMethodEV01charNONENONE

An option that specifies the type of processing for an event.

cDataErrorERRcharNONENONE

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 
external parameter data structure of the Data Dictionary Server.

cForecastAmountsEV02charNONENONE

An option that specifies the type of processing for an event.

mnMethodYieldMN29D9MATH_NUMERICNONENONE

This is a generic field used as a work field in Everest.

mnBestFitMN29D9MATH_NUMERICNONENONE

This is a generic field used as a work field in Everest.

mnLastBucketPositionMATH02MATH_NUMERICNONENONE

- - - Good Performance High Value. 

idPtrToActualValuesGENLNGIDNONENONE

General purpose ID variable.

mnMonthsBestFitMATH01MATH_NUMERICNONENONE

- - - Good Performance Low Value. 

mnLinearApproxNoMonthsMATH01MATH_NUMERICNONENONE

- - - Good Performance Low Value. 

cMeanAbsoluteDeviationEV01charNONENONE

An option that specifies the type of processing for an event.

Related Functions

B3401050 Forecast Accumulate Actuals

Related Tables

None