Creating a Rule
  • 13 Jun 2024
  • 2 Minutes to read
  • Contributors
  • Dark
    Light

Creating a Rule

  • Dark
    Light

Article summary

This topic describes how to create a new Rule and its specific properties.

To create a new Rule, click on the orange plus icon contents/assets/images/data.model.add.PNG in the top left corner next to "Rules" to open the New Rule configuration panel.

Once the configuration panel is displayed, proceed as follows:

  1. Enter the Rule name in the "Title" field. This is how the Rule will be displayed across the application

  2. Select the Entity you wish to define a Rule for from the "Entity" dropdown menu. After selecting the Entity, its members will immediately appear in the formulas area below

  3. Assign the Rule to a group. This helps organize Rules for when you wish to assign them to Blocks in a Layout

  4. Set whether Power users can edit the Rule. This option is selected by default when creating a Rule

  5. Enter the formulas needed next to each Entity member listed in the table

  6. Click "CREATE" to save the Rule.

contents/assets/images/rule panel def.png

The Rule configuration panel allows you to manage a maximum of 65,000 rows.
If one or more formulas contain errors, a notification message will indicate which rows need correction before creating the Rule.

Defining a basic Rule

To reference other members of the Entity within the formulas of the Rule, you must encapsulate the member codes in square brackets, like so: [01]. You can also place the mouse pointer in the formula field and then click on the member code to have it automatically entered in the field with the correct syntax.

In your formulas, you can use the standard arithmetic operators, (+, - , * , /)  and parentheses.

Some functions using ranges are also supported, such as SUM(), AVG() , MIN(), MAX(), NPV(). For example, the formula =SUM([code1]:[code2]) adds values in the range code1 to code2.

The column offset

With this operator, you can define formulas that refer to a previous column in the Layout. Usually, Rule formulas execute calculations in cells of the same column.

With the column offset operator, you can refer to any cell in a previous column. The column offset operator is marked by a point (".") ahead of the element code.

For example, the formula =[. C01] refers to the cell one column to the left of to the cell C01. With this function, a recursive resolution of formulas that refer to other calculated cells will be avoided.
 contents/assets/images/column offset.png

Importing a Rule

Rules can be imported from a tab-separated value text file.
The first column of the file must contain the Entity codes.

It is best practice for all members to be present in the file to ensure that the formulas are assigned to the correct members.
However, it is possible to import only a subset of members that you wish to populate with formula values. You will need to save the Rule after importing to see the result of the import.

The second column must be the formulas assigned to each Entity member.
contents/assets/images/assets/images/export-rule.png

To export and import a Rule via text file, click the EXPORT or IMPORT button above the members table in the configuration panel.

contents/assets/images/rules.export.import1.png


Was this article helpful?