Reverse Rules and Data entry simulation
  • 13 Jun 2024
  • 2 Minutes to read
  • Dark
    Light

Reverse Rules and Data entry simulation

  • Dark
    Light

Article summary

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

A reverse Rule is a Rule with a specific syntax that allows it to write data to one or more Cube cells for other Entity members, depending on the value of the member where the reverse Rule has been defined.

Defining a reverse Rule: what’s the difference to a simple Rule?

A reverse Rule is marked by a pipe character ("|") ahead of the formula. Reverse Rules can coexist with simple Rules in the same formula defined on a single member.

Let's consider the following scenario:

contents/assets/images/reverse.rules.eg.1.png

In this scenario, as you enter any value for member [0], members [1], [2], and [6] are calculated and written in the Cube, just like with Data entry actions: their value is the result of [0]+1, [0]+2, and 2*([0]+1) respectively.

The same result can also be obtained using the following simple Rule. The difference from the scenario shown above is that values for members [1] and [2] are not written in the Cube. In both scenarios, the value for member [6] is calculated and visualized, but not written in the Cube.

contents/assets/images/reverse.rules.eg.2.png

You can set an unlimited number of reverse formulas for a single member.
You can set reverse Rules in combination with simple Rules in the same formula field, but simple Rules must always precede reverse Rules.
The result of the Rule calculation is immediately visible in the Layout preview as soon as the Rule is applied to a Cube.

Simple Rules prevail over Reverse Rules

Let's consider the following scenario:

contents/assets/images/reverse.rules.eg.3.png

In this case, the value saved for member [1] is equal to the double of the value for member [0], but the value visualized for member [1] is equal to the double of the value for member [2]: there could be a misalignment between the written value and value visualized in reports.

The order of formulas in a reverse Rule affects the results of the calculation

Reverse Rules are executed from left to right. For example, the following 2 Rules give 2 different results:

contents/assets/images/reverse.rule.calc.4.and.5.png

In the first Rule, if the value entered for member "0" is 10, then the value written for member "1" would be 20, and the value written for member "2" would be 40.

In the second Rule, if the value entered for member "0" is 10, then the value written for member "1" would be 0, and the value written for member "2" would be 20. This is because the first formula is executed before the second one, and the second one is the one that writes one of the arguments of the first formula.

The result of the reverse Rule calculation is immediately visible in the Screen as soon as a value is saved in the Cube. If Save/Undo mode is enabled on the Screen, after you enter a value, you must click the save icon at the top left of the Object to actually save the value in the Cube and trigger the Rule calculation.

Known limitations of Reverse Rules

  • Reverse Rules will not work if additional Entities are set By Row in the Layout, along with the Entity on which the reverse Rule has been defined

  • For reverse Rules to work, the "Show all" property must be enabled for the By Row field in the Layout

  • Reverse Rules will not work if the Entity on which the reverse Rule has been defined is set By Column

  • The "Cube cells locked by" option is ignored if a reverse Rule is defined to write data to a locked cell, since reverse Rules are always allowed to write to any cell of the Cube.


Was this article helpful?