Alternate hierarchies and rules

The Rules Engine has been expanded to work with hierarchies. Generally, if a reference to an element does not specify a hierarchy, then the default hierarchy is used.

To specify a hierarchy other than the default hierarchy in a static reference, use this syntax:

[DIMENSION:HIERARCHY:ELEMENT]

The hierarchy is specified as the second token of the full definition of a reference to an element. For example:

[REGIONS:'Structure as of 2015':Germany]

This example uses the element Germany of the Structure as of 2015 hierarchy in the REGIONS dimension.

Shorter forms are supported. Short forms implicitly refer to elements on the default hierarchy. For example:

[REGIONS:Germany]

This example refers to the Germany element of the default hierarchy of the REGIONS dimension.

The shortest form is:

[Germany]

This example refers to an element called Germany of the default hierarchy of an unspecified dimension.

If a reference is ambiguous, an error is reported.

There are rule functions that accept element names as parameters and have an implicit dimension reference. To pass hierarchies as well, use the ElementInHierarchy function. It takes two parameters to identify an element, providing a hierarchy context. For example:

ElementInHierarchy('Structure as of 2015','Germany')

This example refers to the Germany element of the Structure as of 2015 hierarchy. The dimension is deduced from the context of the function. For example, when ElementInHierarchy is used as a parameter of a DB function.

This way all elements of all hierarchies can be addressed.

These constructs can be used:

  1. [Products:OldHier:Total] = formula

    [Products:NewHier:Total] = formula

    Multiple rule targets referring to different elements with the same name in the same dimension but different hierarchies.

  2. [Products:{OldHier:Total , NewHier:Total}] = formula

    Two rule targets from 1 are combined in one rule target. The two elements have been put into a list.

  3. [Products:NewHier:Total] = [Products:OldHier:Total]

    An element in one hierarchy can refer to an element in another hierarchy.

  4. [Products:OldHier:Total] = formula

    [Products:OldHier:Total] = another formula

    If multiple rules refer to the same area, only the first rule is executed. In this case, the target areas are the same, therefore the second one is never executed.