Create Formula

The purpose of this procedure is to:

  • Specify formulas for dynamic calculation of material quantities, operation times, sales prices, or drawing measurements when a product is configured.
  • Specify formulas for the markups for elements in the purchasing model. The procedure also includes checking the formulas through simulation.

The procedure also includes checking the formulas through simulation.

Before you start

Before you can begin to create a formula, these prerequisites must be met:

  • Features are entered in program 'Feature. Open' (PDS055).
  • Drawing measurements are specified in program 'Drawing Measurement. Open' (PDS080).
  • Units of measure are specified in the program 'Unit of Measure. Open' (CRS050).
  • Where the result of a matrix table lookup is used in a formula as type 7 (Matrix) factor, the matrix must be correctly configured in 'Selection Matrix. Open' (PDS090).
  • Where custom fields are used in a formula they must be defined for either item or supplier.

Follow these steps

Follow the steps below to create a formula.

  1. Select program 'Formula. Open' (CRS570). Include panels E and 1 in your panel sequence.

  2. Create a formula.

  3. Fill in or change the information in the formula header in panel E. Specify the search hierarchy to be used, since this simplifies creating formula lines. The hierarchy has a certain effect on response times, but is most important when there are features, drawing measurements or projects with the same ID. Program 'Formula Lines. Open' (CRS575) is now opened. If program (CRS575) is run for the first time, options should be set using F13='Parameters'.

  4. Specify the formula lines using related option 11. If a calculation has more than two factors, continue to the next line without specifying a result. If a calculation should be made and different formulas used depending on the value of a factor, then Boolean algebra (IF, OR, AND, ELSE and END) can be used. The sequence number regulates the order of the calculations. If it is left blank, it is set automatically according to the range specified in the panel reached using F13='Parameters'. The same applies for the factor type, which is set according to the hierarchy selected in the formula header. A formula can have several results, so similar calculations can be combined in one formula. This can be useful when subtotals in one calculation should be reused in another calculation, since results cannot be obtained from other formulas.

    • These factor types are available for use in a formula:
      • 0 - Blank
      • 1 - Constant value or result ID in the formula
      • 2 - Drawing measurement
      • 3 - Feature
      • 4 - Retrieved constants
      • 5 - Attribute
      • 6 - Test
      • 7- Matrix. The result of a Matrix table look up
      • 8 - User Defined Fields. The same user defined field can be defined at different levels. When a formula is called in connection with a purchase order they will be searched and retrieved in the following order: from purchase agreement line, then agreement header, then item number, then supplier. When no agreement the search/retrieval will be by item and then supplier. When not purchase the search/retrieval will be by item only.
    • You can define a date when using factor types 4, 5, or 8 to calculate the difference between two dates in number of days. When used, both factors on the line must be date type and Boolean processing code DO must be used. A date can be one of the following:
      • Received Date
      • Current Date
      • Custom Field of type Date
      • Attribute of Type Date
    • A formula can have several results, so similar calculations can be combined in one formula. This can be useful when subtotals in one calculation should be reused in another calculation, since results cannot be obtained from other formulas.
  5. A brief textual note for each formula can be specified in the detail panel. In this panel, processing of negative values which are normally only specified in the formula header can be overriden.

  6. Simulate the formula using program 'Formula. Simulate' (CRS576). To call this program, press F15='Simulation'. Specify the values and perform the simulation. Sorting order 2 in program (CRS576) offers more of an overview, while sorting order 1 allows you to follow the calculation step by step.

Output

A formula is created when using this procedure. It can be manipulated using simulations, and can be used to calculate sales price, material consumption, run time for an operation and various measurements.

Description

In the example below, several calculations are to be performed.

Width - 40 = Wid01 (Answer should be rounded upwards to one decimal place)

Wid01- 1 = Wid02

Depth - 34 = Dep01

Width * Depth * (Height /1000) = Price if width > 100, otherwise price = 10000

In these calculations, Width, Depth and Height are features. To perform the following calculations, a formula can be created as outlined below.

Sno

Boo

Op

Par

Ftp

Factor 1

Par

Op

Par

Ftp

Factor 2

Par

Res

Neg

Rnd

Rul

10

3

WIDTH

-

1

40

WID01

1,0

+

20

3

WID01

-

1

1

WID02

110

3

DEPTH

-

1

34

DEP01

180

IF

3

WIDTH

>

1

100

190

DO

3

WIDTH

*

3

DEPTH

200

DO

*

(

3

HEIGHT

/

1

1000

)

PRICE

210

EL

1

10000

PRICE

220

EN