Formulas and Variables—Key Exercises

Required Data

This exercise requires that you have completed the following exercise:

Main Exercise

Purpose: The purpose of this exercise is to create variables and formulas that can be used in an Input UoM (Unit of Measure) Group.

Windows:
Formula Variables
Formulas
Formula

Creating a Variable

In this exercise you will create the variables, to be used in the formulas created later.

  1. Open the Formula Variables window. 
  2. Populate the window and review the variables that are available to be used in this system environment.
  3. Create a new row.
  4. Enter the following information into the row: 
Variable ID Description UoM
XX_QUANTITY Quantity in pcs pcs
XX_LENGTH_MM Length in mm mm
XX_WIDTH_MM Width in mm mm
XX_THICK_MM Thickness in mm mm
XX_DENSITY Density in kg/m3 kg/m3

where XX is your initials

Note: UoM (Unit of Measure) has to be an ISO Unit. 

  1. Save the new unit.

Creating a Formula

In this exercise you will create a formula for calculating the total length in meter (m) for a specified quantity of a specific length in millimeter (mm), using the variables created in the previous lesson.

  1. Open the Formulas window. 
  2. Create a new formula by selecting New (F5).
  3. Enter XX_QTY_LENGTH_M as the Formula ID and select m as the Formula UoM
  4. Save the formula.
  5. Create new rows in the upper table in the view.
  6. Enter the following information:

Sequence Item Type Item Description Notes
10 Variable XX_QUANTITY Quantity in pcs  
20 Operator Multiplication *
30 Variable XX_LENGTH_MM Length in mm
40 Operator Division /    
50 Value 1000   mm to meter 

Note: You need to enter the item type before selecting an item. 

  1. Save the formula.

Note: By saving the formula rows, the lower table is created. This table contains the variables entered in the upper table. In order to be able to test the formula, test values have to be entered for each variable.

  1. Enter the following test values:  
Variable ID Description UoM Value Type Value Test Value
XX_QUANTITY Quantity in pcs pcs User 10
XX_LENGTH_MM Length in mm mm Default  1500 1500
  1. On saving, the Test Formula button in the header will be enabled. 
  2. Click Test Formula
  3. This should give the following result:
    Formula: XX_QUANTITY * (XX_LENGTH_MM / 1000)
    Test Result: 10 pcs * (1500 mm / 1000) = 15 m

Note: In order to be able to use the formula the status has to be set to Valid.

  1. Right-click in the header and then click Valid from the menu shown. 

Creating a Complex Formula

In this exercise you will create a complex formula for calculating the weight in kilograms (kg) of a steel plate, using the variables created in the previous lesson. The result of the calculation should be rounded to two decimals. 

  1. Open the Formulas window.
  2. Create a new formula by selecting New (F5).
  3. Enter XX_WEIGHT as the Formula ID and select kg as the Formula UoM
  4. Save the formula.
  5. Create new rows in the upper table in the view.
  6. Enter the following information:  
Sequence Item Type Item Description Notes
10 Function ROUND    
20 Operator Open Parenthesis (    
30 Variable XX_LENGTH_MM Length in mm  
40 Operator Multiplication *    
50 Variable XX_WIDTH_MM Width in mm  
60 Operator Multiplication *    
70 Variable XX_THICK_MM Thickness in mm  
80 Operator Multiplication *    
90 Variable XX_DENSITY Denisty in kg/m3  
100 Operator Multiplication *    
110 Function POWER    
120 Operator Open Parenthesis (    
130 Value 10    
140 Operator Comma ,    
150 Value -9    
160 Operator Close Parenthesis )    
170 Operator Comma ,    
180 Value 2    
190 Operator Close Parenthesis )    

Note: You need to enter the item type before selecting an Item. 

  1. Save the formula.

Note: By saving the formula rows the lower table is created. This table contains the variables entered in the upper table. In order to be able to test the formula, test values have to be entered for each variable. 

  1. Enter the following test values:
Variable ID Description UoM Value Type Value Test value
XX_LENGTH_MM Length in mm mm User   3000
XX_WIDTH_MM Width in mm mm User   1500
XX_THICK_MM Thickness in mm mm Default 10 10
XX_DENSITY Denisty in kg/m3 kg/m3 Fixed 7850 7850
  1. On saving, the Test Formula button in the header will be enabled. 
  2. Click Test Formula.  
  3. This should give the following result:
    Formula: [KK_LENGTH_MM * KK_WIDTH_MM * KK_THICK_MM * KK_DENSITY * POWER (10 , -9) , 2]
    Test Result: [3000 mm * 1500 mm * 10 mm * 7850 kg/m3 * POWER (10 , -9) , 2] = 353.25 kg

Note: In order to be able to use the formula the status has to be set to Valid.

  1. Right-click in the header and then click Valid from the menu shown.