You are here: Using MONITOR Procedures > Product Configurator > Formula Window

Formula Window

This chapter describes the cases where variables are applied in the Product Configurator. In order to use variables, you have to activate the setting Use variables under the Product Configurator under the System tab in the Settings procedure.

When variables are applied in the Product Configurator, you can enter formula rules on selection groups and selection alternatives for selection groups in the Update Configuration Group procedure. You can also enter quantity formulas for the selection alternatives. For numerical variables you can enter calculation formulas and for text variables you can enter text values.

In the Update Part and Preparation procedures you can enter price formulas for the parts. In the Preparation, you can also enter formulas for setup time and unit time on operation rows. On material rows, you can enter quantity formulas. Further, you can enter instruction formulas on both operation and material rows.

Below you will see a description of the formula windows including some examples of which kind of formulas and functions that can be entered there.

The more advanced formulas are intended for those who already have calculation experience, are calculation engineers, etc. Alternatively, you can create advanced formulas in consultation with an instructor or a consultant at Monitor ERP System AB. You can also participate in a training course on product configuration with variables. Please contact Monitor ERP System AB by phone +46 650 766 00.

Calculation Formulas for Numerical Variables

For the variable type Numerical in the Update Configuration Group procedure, you can enter a complex calculation formula that consists of other numerical variables and text variables. You can also make the variable a constant by entering a numerical value in the formula window.

The variables that are defined on the configuration group are displayed under Variables in the window, except for the variable for which the formula window applies. To create calculation formulas, you use Variables, Operators, Terms and, in some cases, Functions.

A formula is created by positioning the cursor on the Formula area of the window and clicking on the selected variable, operator, term and function, if any.

Formula window for calculation formula for numerical variable.

Text Values for Text Variables

For the variable type Text in the Update Configuration Group procedure, you can enter a complex text value that consists of other numerical variables, text variables and variable names.

The variables that are defined on the configuration group are displayed under Variables in the window, except for the variable for which the formula window applies. To create text values you use Variables (empty if no value) and Variables (name if no value).

A formula is created by positioning the cursor on the Formula area of the window and clicking the selected variable (value and/or name). The text values for text variables can with advantage be combined with static text.

The formula window for text value for text variable.

Quantity Formula

You can enter a quantity formula on a Selection alternative for selection group in the Update Configuration Group procedure. You enter the formula in a window that opens by clicking the f(x) button on the selection alternative row. A quantity formula generates a numerical value as a result.

On material rows in the Preparation procedure you can also enter quantity formulas for Setup quantity and for Quantity. To be able to apply quantity formulas on material rows, the Use quantity formula (only config.) setting must be configured as "Yes, quantity" or "Yes, both setup quantity and quantity", under the Preparation heading under the Manufacturing tab in the Settings procedure.

The variables that are defined on the configuration group are displayed under Variables in the window. To create quantity formulas, you use Variables, Operators, Terms and, in some cases, Functions. You can also enter numbers in a formula by entering them manually in the formula.

For example, in the quantity formula below, [H] * [W] is divided by the constant 1000000 to generate the unit m2, since height and width in this case is entered in the unit mm.

Formula window for quantity formulas.

Formula Rule

You can also enter a formula rule on a Selection group or a Selection alternative for selection group under the Rf(x) button on the selection group or selection alternative row. A formula rule generates a true or false value as a result. You can choose to exclude or include the selection alternative when the condition is fulfilled or not.

Besides variables, operators and functions, you use Conditions to create formula rules. You can also create more advanced formula rules by using if-clauses as conditions/terms.

The example below shows a formula rule where the selection alternative "H141 Hook, small" is excluded if [H] * [W] is larger than 1000000 (in this case mm2).

Formula window for formula rules.

Price Formulas

You can enter a price formula on a part. You enter the price formula under the Price formula button in the Update Part or Preparation procedures. A price formula is a quantity formula that is multiplied by the part price in the configuration window to calculate the correct part price based on the variables in the formula. A part with a price formula can be included in several configuration groups, and therefore, you can add the configuration groups in question at the top of this formula window.

Formula window for price formulas.

Formulas for Setup Time and Unit Time

You can enter formulas for both setup and unit time on operation rows in the Preparation procedure. Formulas for setup and unit time generate a numerical value. To be able to apply formulas for setup and unit time, the Use time formula (only config.) setting must be configured as "Yes, unit time" or "Yes, both setup and unit time", under the Preparation heading under the Manufacturing tab in the Settings procedure. The formulas calculate setup and unit time based on the variables entered in the configuration on a manufacturing order.

Instructions with Formulas

You can enter instructions with formulas on selection alternatives in the Update Configuration Group procedure, and on operation and material rows in the Preparation procedure. The formulas are used as variable values in the instructions. An instruction with formulas can be included in several configuration groups, and therefore, you can add the configuration groups in question at the top of this formula window.

To be able to apply instructions with formulas in preparations, the Use instruction formula (only config.) must be configured as "Yes, operation", "Yes, material" or "Yes, both operation and material", under the Preparation heading under the Manufacturing tab in the Settings procedure.

The formulas are general quantity formulas (see above) that are combined with an instruction in the window. The instructions with formulas are entered under the IC (Instruction for configuration) button on selection alternatives and on operation and material rows. In preparations, the instructions with formulas replace the regular instructions under the I button.

The instructions with formulas on operation and material rows are included in manufacturing orders where the instruction and the earned value from the formulas are displayed.

The instructions with formulas on selection alternatives and material rows can also be included in purchase order suggestions and purchase orders if the Insert text rows on P-order from instruction on material setting has been activated under the Product Configurator heading under the System tab in the Settings procedure.

The example below shows an instruction with formulas that generate a cutting measure for the mirror glass, based on the formulas: Height = [H]-2*[FW] and Width = [W]-2*[FW]

[H] = Height incl. frame, [W] = Width incl. frame, [FW] = Frame Width.

Formula window for instruction formulas.

Formulas are added in the window by using the Add... button. A formula is added where the cursor is positioned in the text window. You can delete selected formulas by using the Delete button. You can edit a formula by double-clicking the formula number "{n}" in the text window or by clicking on the [#]f(x) button in the table in the lower portion of the window.

Please note that the formula number in the text window shall be enclosed in braces "{}" if you e.g. want to move the formula in the text window and enter it manually somewhere else in the instruction.

Formula

This section is used to create and edit the formulas. Variables, conditions and functions are added to the formulas by clicking them. You can also enter the formulas manually, if you e.g. want to enter a number. If you create long and complicated formulas, you may have to divide them by line breaks. Line breaks and spaces are ignored in the formulas.

Please note that if you use decimals in a formula, the decimal separator shall be a period ".", otherwise you will get a syntax error.

Variables

Here you will see the variables that are defined in the configuration group.

Operators

The operators that you can apply in formulas are:

Conditions

The conditions/terms that you can apply in formulas are:

Example of how to enter conditions:

Here you will see an example of how to enter the condition if(condition, true, false): The condition/term indicates that if the variable [L] is larger than 100, apply the value 5, otherwise apply the value 3. The values 5 and 3 can also be mathematical functions.

if([L]>100,5,3)

Functions

The set of functions that is included and can be applied in formulas is:

Examples of how functions are entered in formulas:

The first example below shows a quantity formula that is entered on the material row for clips to a mirror frame in the preparation and that calculates how many clips that need to be used in the mirror frame, based on the mirror frame's width [W] and height [H] in mm. Since the number of clips can only be a whole number that we also want to round off, we use the function Floor(x) in order to generate the minimum quantity of clips to be used.

Floor(2*([W]+[H])/1000)

The second example describes a rounding off where decimals can be included. Here we use the function Round(x, decimals). In the example, the measure in the variable [L] is divided by 3, and rounded off to the nearest zero quantity of decimals (that is a whole number).

Round([L]/3,0)

This is an example of how to use the function Round(x, decimals) if you want to generate an even number of tens, hundreds etc. Here the variable [L] is rounded off to an even number of hundreds.

Round([L]/100,0)*100

This example describes the function Max(x,y). The function takes the maximum value in the variables [H] or [W]. The opposite function Min(x,y) takes the minimum value in the variables.

Max([H],[W])

This example describes how you enter functions when angles are used. Based on mathematical rules, we know that following applies to a right angle:

Let us suppose that it is the length of (b) that we shall calculate. If we have the length (a) as the variable [A] and the angle (v) as the variable [V], we can figure out (b) based on the rule above. Here we can use the function Tan(x) to calculate (b). The formula to be entered is:

Tan([V]*Pi()/180)*[A]

Please note that degrees are calculated in radians, and therefore, you have to multiply them by Pi()/180, in those functions where degrees are used. Please note also that the function Pi() always shall be entered exactly this way in a formula.

This final example describes functions to calculate the length of sides in the right angle triangle as in the example above. Here we make use of another mathematical rule; Pythagoras' theorem. According to that rule the following applies:

Let us assume that it is the length of (c) in the triangle above that we shall calculate. If we have the length of (a) as the variable [A] and length (b) as the variable [B] then we can get (c) according to Pythagoras' theorem. The formula to be entered is:

Sqrt(Pow([A],2)+Pow([B],2))

The Test Formula Button

By using this button, you can test that the formula generates the correct result, if it is e.g. a quantity formula. If it is a formula rule, it generates a true or false result. In a window that opens, you can enter optional variable values and see the result in the lower portion of the window. If there is a syntax error in the formula, a message appears informing you about the error.

Please note that if you enter decimals here, the decimal separator shall be a comma ",", otherwise you will get a syntax error.

The Clear Formula Button

By using this button, you can clear the entire formula section.