ForecastCalculateBestFit

Forecast Calculate Best Fit

Major Business Rule

Object Name: B3401010

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose
This function accumulates quantity and amount totals for the best fit period. This data will be used 
when calculating the 12 forecasting methods.


1.2Setup Notes and Prerequisites


1.3Special Logic


2.Technical Specifications

1.Find the Customer in PtrToCustomers at the position CutomerToRetrieve
Return in CustomerNumber the number of customer at that position

Return in PntrToActualValues the pointer associated with this customer number.


2.Load the number of buckets that have data into NumberOfBuckets

Move 1 to NumberOfBuckets
Look for the first position in the PntrActualValues list that is not equal to NULL
If a position is found

And LastBucketPosition is greater than or equal to that position

Subtract the position from LastBucketPosition to get NumberOfBuckets

Add 1 to NumberOfBuckets

End

 

3.Calculate a quantity and amount total for the best fit period.

If MeanAbsoluteDeviation is not equal to 1
Move LastBucketPosition to $X
Do the following MonthsBestFit times

If $X is greater than zero

Add PntrActualSales,$X to QtyBestFit

Add PntrActualAmount,$X to AmtBestFit

End

Subtract 1 from $X

EndDo

End


^

Data Structure

D3401010 - Forecast Calculate Best Fit

Parameter NameData ItemData TypeReq/OptI/O/Both
idPtrToActualValuesGENLNGIDNONENONE

General purpose ID variable.

idPtrToCustomersGENLNGIDNONENONE

General purpose ID variable.

mnNumberOfBucketsMATH01MATH_NUMERICNONENONE

- - - Good Performance Low Value. 

mnLastBucketPositionMATH01MATH_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.

mnCustomerNumberAN8MATH_NUMERICNONENONE

A number that identifies an entry in the Address Book system, such as employee, applicant, participant, customer, supplier, tenant, or 
location.

mnCustomerToRetrieveMATH01MATH_NUMERICNONENONE

- - - Good Performance Low Value. 

cMeanAbsoluteDeviationEV01charNONENONE

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

mnMonthsBestFitMATH01MATH_NUMERICNONENONE

- - - Good Performance Low Value. 

Related Functions

B3401050 Forecast Accumulate Actuals

Related Tables

None