Computing Formulas in the Data Manager

The main Data tab in the Data Manager task includes a formula bar, where you can define attributes by using columns, constants or functions in formulas.

The formula bar is divided into two distinct parts:

  • left-hand side member: corresponds to the attribute which will be defined by the formula. 

  • right-hand side member: contains the formula to define the new attribute.

Values can be entered manually, selected from the corresponding drop-down list or inserted by clicking on a cell in the spreadsheet. When you click on a cell in the spreadsheet, the corresponding attribute is added in the formula, with the format $"attribute_name". Functions and operators can also be used to define the formula.

Process variables can also be used in formulas. They are recognized by the "@" prefix. For example, @Today could be a process variable that contains the current date. For more information on process variables see Using Process Variables in the Factory.

 

When typing formulas, the complete formula with the parameters is displayed under the formula bar with a MONACO editor.


Procedure

  1. In the formula bar, in the left-hand side member, enter the attribute you will be defining in one of the following ways:

    • select an existing attribute from a drop-down menu;

    • click on a cell in the spreadsheet.

  2. Click the function button and select the function required to create the formula. For a list of functions provided by Rulex, see Formulas and Functions in the Factory.

  3. In the right-hand side member, create the formula which will define the attribute by:

    • entering attributes

    • entering constants.

  4. Press enter or click on the apply button.

Selecting multiple attributes

  • If you need to select more than one attribute at a time, you can use either press Ctrl and select all the required attributes: ($"att1", $"att5", $"att11")

  • If you need to select a range of attributes, you can either press Shift and select the first and last attribute in the range, or select them all with the cursor. The formula bar will include a colon to indicate the range: $"att1":$"att5"

Examples of multiple selection syntax:

  • $"att_sum" = sum($"att1",$"att5", $"att11")

  • $"att_sum" = sum($"att1":$"att5")