ForecastSimulateMethod1

Forecast Simulate Method 1

Major Business Rule

Object Name: B3400830

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose
This function will generate the forecast numbers for Method 1, 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 1 - Simulate Simple Percent 
If MonthlyVsWeekly is not equal to 1

BucketsInYr = 12

Else

BucketsInYr = 52

End


If NumberOfBuckets is less than BucketsInYr + MonthsBestFit

Move '1' to DataError

End Function

Else

If MeanAbsoluteDeviation is not equal to 1

LastYrNMonths = 0

Subtract BucketInYr from LastBucketPosition to get $X

Do MonthsBestFit times

If ForecastAmounts is not equal to 1

Add PtrToActualSales,$X to LastYrNMonths

Else

Add PtrToActualAmounts,$X to LastYrNMonths

End

Subtract 1 from $X

End


Multiple LastYrNMonths by PercentOverLastYr 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 1 to Method

EndElse

$TOT = 0

Move LastBucketPosition to $X

Do MonthsBestFit times

If ForecastAmounts is not equal to 1

Multiply PtrToActualSales,($X - BucketsInYr) by 

PercentOverLastYr to get $Z

Subtract $Z from PtrToActualSales,$X to get $DIFF

Else

Multiply PtrToActualAmounts,($X - BucketsInYr) by 

PercentOverLastYr 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

End


^

Data Structure

D3400830 - Forecast Simulate Method 1

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.

mnPercentOverLastYrMATH02MATH_NUMERICNONENONE

- - - Good Performance High Value. 

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.

mnMonthsBestFitMATH01MATH_NUMERICNONENONE

- - - Good Performance Low Value. 

cMonthlyVsWeeklyEV02charNONENONE

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

cMeanAbsoluteDeviationEV01charNONENONE

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

idPtrToActualValuesGENLNGIDNONENONE

General purpose ID variable.

mnLastBucketPositionMATH01MATH_NUMERICNONENONE

- - - Good Performance Low Value. 

Related Functions

B3401050 Forecast Accumulate Actuals

Related Tables

None