- 20 Aug 2024
- 2 Minutes to read
- Print
- DarkLight
Creating a Rule
- Updated on 20 Aug 2024
- 2 Minutes to read
- Print
- DarkLight
This topic describes how to create a new Rule and its specific properties.
To create a new Rule, click on the orange plus icon in the top left corner next to "Rules" to open the New Rule configuration panel.
Once the configuration panel is displayed, proceed as follows:
Enter the Rule name in the "Title" field. This is how the Rule will be displayed across the application
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
Assign the Rule to a group. This helps organize Rules for when you wish to assign them to Blocks in a Layout
Set whether Power users can edit the Rule. This option is selected by default when creating a Rule
Enter the formulas needed next to each Entity member listed in the table
Click "CREATE" to save the Rule.
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.
Data picker syntax
You can use Data picker syntax in the formula field of a Rule to select a value from a specific Cube and Entity member, multiple Entities, multiple members, or a combination. Data picker syntax can also be used in a formula, referenced from a specific line using the “Code” number and used in a formula, and used in “If, then, else” statements.
Read more about Data picker syntax in the About Data pickers article.
Importing and exporting Rules
Rules can be imported or exported.
To export and import a Rule via text file, click the EXPORT or IMPORT button above the members table in the configuration panel.
Importing Rules
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.