Show TOC

Syntax documentation*RUNLOGIC Locate this document in the navigation structure

Allowed uses: Global, MDX, SQL

Allows you to redirect the execution of a logic file towards a different data region than the one for which the logic was originally executed. Used with *APPSET, *APP, *LOGIC, and *DIMENSION.

These instructions can be used to redefine:

  • The application set

  • The application

  • The selection of dimension members

  • The logic to run

Possible uses:

  • To enter data in one period and trigger an allocation across all periods of the year

  • To enter data in one entity and trigger the elimination logic for the elim-entities

  • To modify an exchange rate in the rate application and trigger a translation in the main application

The instructions must be written between a *RUNLOGIC and a *ENDRUNLOGIC command. Here is the full list of supported instructions:

*RUNLOGIC

*APPSET= {AppSet} //optional

*APP = {App} //optional

*LOGIC = {logicname} //required

*DIMENSION {dimname} = {member set} //optional (one per dim allowed)

*ENDRUNLOGIC

All instructions are optional except *LOGIC.

The following list is a summary of rules regarding the *RUNLOGIC instruction:

  • All logic properties that are not redefined with one of these instructions retain the values they have in the calling logic (for example, if the application is not redefined, the rules push is performed against the original application).

  • The RUNLOGIC sections contained in a logic file is executed at the END of the entire rules execution, regardless of their position in the rules relative to all other statements.

  • Multiple RUNLOGIC sections can be entered in the same rules file. They are executed in the order in which they are encountered.

  • RUNLOGIC sections contained in rules called by a RUNLOGIC statement are ignored (In other words RUNLOGIC calls cannot be nested). •

  • The instruction DIMENSION can be used to redefine the scope of execution in a given dimension. Multiple DIMENSION instructions can be used to redefine the member sets of multiple dimensions in the current data region.

Example Example

//execute eliminations in elim entities

//---------------------------------------------------------------------

*RUNLOGIC

*DIMENSION ENTITY=filter([entity].members,[entity].property('ELIM')='Y')

*LOGIC=Intco

*ENDRUNLOGIC //execute currency translation in main app

//---------------------------------------------------------------------

*RUNLOGIC

*APP=MAIN

*DIMENSION ENTITY2= //blank out scope of invalid dims

*LOGIC=DefaultTranslation

*ENDRUNLOGIC

End of the example.
Special Keywords in the DIMENSION instruction

The strings passed to the instruction DIMENSION can contain the keyword:

%{dimname}%

Example Example

If the main logic is being run for entity EUROPE, the following logic push is executed for all children of EUROPE:

*RUNLOGIC

*DIMENSION ENTITY= [ENTITY] [%ENTITY%] children

*LOGIC=SomeLogic

*ENDRUNLOGIC

End of the example.

If the main rules were run for more than one entity (for example, EUROPE and US), the logic push is performed for the children of each of them, using the following selection in the rules query:

{[ENTITY].[EUROPE].children, [ENTITY].[US].children}

This works if the calling selection enumerates the members individually, as follows:

DIMENSION:ENTITY

EUROPE, US

In case the calling selection contains an MDX statement, this is treated as one member. The following example would not work in the above context

DIMENSION:ENTITY

[WORLD].children

Members subnames

The keyword %DIMNAME% can be adjusted to return only the prefix or the suffix of a member name.

If the passed member set for the TIME dimension contains the member:

2001.JAN

The keywords return:

%TIME% 2001.JAN

%TIME_PREFIX% 2001

%TIME_SUFFIX% JAN

Example Example

Here is an example that uses the prefix keyword to perform an allocation:

*RUNLOGIC

*DIMENSION TIME=descendants([time].[%TIME_PREFIX%.total],99,leaves) *LOGIC=AllocationLogic

*ENDRUNLOG

If the user enters data for more than one month for the SAME year, the rules push is smart enough to process that year only once.

End of the example.