Working with Business Rules

Working with Business
Rules
General information about rules
Jedox Enterprise Rules enhance this functionality and enable you to
execute complex calculations (division/multiplication, logical and
various functions). The general syntax of Rules is
[Target] = f[Source]
i.e. [Target] is a function of [Source]
Whereas [Target] is the area in the cube that is to be calculated using
rules. This target area is defined by dimension elements. Elements are
not to be listed, if a rule is to apply to all dimension elements. Rules
are mapped out per cube.
IMPORTANT: If a target area is defined in a rule, subsequent rules,
which describe the same or an overlapping target area, are no longer
effective. This means that specific rules have to be stored before
general rules. Only exception is rule function CONTINUE that can switch
from one rule into another rule defined on overlapping target areas.
You can get to the Rule Editor via the context menu after a right-click
on the cube in the Modeller, or alternatively, you can click on the
symbol after you have selected a cube:
Copyright © Jedox AG
Creating a simple rule
Note: “Jedox Excel Add-in” includes the rule editor (advanced). This
component is not yet available in Jedox Web. The steps are the same
or similar in both software versions.
Simplified example using the cube Sales of the database “Demo”:
RULE 1: [‘2015’] = 123
Copyright © Jedox AG
The target area is the year 2015 of the dimension “Years”. This rule
has the effect that all cells in the cube now contain the value 123 in the
year 2015. The other years are not affected by this rule. Since for all
other dimensions the elements were omitted, the rule applies in the
other dimensions to all elements.
For a new rule click on “New…” in the Rule Editor. Then enter he rule
and confirm the entry. Now create a view in order to check the result.
Organize the view in such a way that the years 2013 up to 2015
become column headers. Place “Products” in the Row titles and select
all products.
Some comments on this view: The values in column D are retrieved
from the corresponding cube-cell by the PALO.DATAC()-function. For
2015, this value was zero throughout. The values currently displayed in
this view are computed using the rule, but the values stored in the
data-base remain zero (i.e. the displayed values are not being written
Copyright © Jedox AG
back to the data-base (Which is the case with entries made in cells!).
The current computation of this view, using the rule, also shows that
consolidated values are not computed: The rule simply overwrites the
values. If you delete the rule again, the values according to their
consolidation will be displayed again.
Operators of the Rule-Editor
The following operators can be used in rules:
+
–
*
/
==
!=
<
<=
>
<=
@
The operators which are not yet known from Excel will now be
described: == is equal to (in Excel = is used) != is not equal (in Excel
<> is used) These operators may be used in the IF function. @ is used
only for markers
Restricting the target area
In the next step, please create a rule that will show for “Desktop L” in
the year 2015 a value that is 10% higher than in 2012. The target area
is “2015” and “Desktop L”. The function for the source is “2012”,
“Desktop L” multiplied by 1.1. If the target area contains a part of the
source area, as in the example “Desktop L”, it does not have to be
repeated in the source area. The conclusion is the following rule:
RULE 2: [‘2015′,’Desktop L’] = [‘2012’]*1.1
Copyright © Jedox AG
The target area is the year 2015 of the dimension “Years” of the
product “Desktop L”. This rule has the effect, that in 2015 all “Desktop
L” cells of this cube show the 2012 value multiplied by 1.1. The other
years and products respectively, are not affected by this rule.
IMPORTANT: Since you already defined the target area for the entire
year of 2015 in the previous rule (Rule 1), Rule 2 will only have an
impact if you place it in front of the more general rule for 2015. You
can change the order of execution using the arrows in the rule editor.
In general we can advise to restrict target in as many dimensions as
possible. This reduce total amount of rule calculated cells and should
improve performance. The target area reduction should be considered
even if it means to define more rules instead of one. Amount of defined
rules has usually much smaller negative impact on performance than
bigger size of target area of one rule. Besides a short notation, element
names can be submitted along with dimension name. Short form:
[‘2015′,’Desktop L’] = [‘2012’]*1.1 Long form:
[‘Years’:’2015′,’Products’:’Desktop L’] = [‘Years’:’2012′]*1.1
This makes sense only when the same element name occurs under
several dimensions. In order to get the correct ordering, the new rule
must be placed before the rule [‘2015’] = 123. If the general rule
[‘2015’] = 123 were to occur before, then that rule would be applied
to all cells in [‘2015’] and the more specific rule standing further down
in the list,
[‘2015′,’Desktop L’] = [‘2012’]*1.1
would be ignored for calculation. Possible prior consolidations will
be consistently overwritten by the rules without any error
Copyright © Jedox AG
message (cells D9 and D10).
Restricting the target area to an element type
If a rule is to apply to base elements only (consolidated elements will
be aggregated as usual), the target area may be defined as follows:
[Target]=B: f[Source]
Vice versa, it is also possible to restrict the target area to consolidated
elements.
[Target]=C: f[Source]
Please change both rules as follows:
[‘2015’] = B:123 [‘2015′,’Desktop L’] = B:[‘2012’] * 1.1
Deactivation in the case of references to removed
elements
Rules with element entries that were removed will only be disabled and
are still available on the server for manual correction.
Copyright © Jedox AG