Show TOC

Syntax documentation*Memory Variables Locate this document in the navigation structure

It is possible to create intermediate result and assign them to dummy members (such as dummy accounts or dummy members of any other dimension). These members can be used as placeholders to store intermediate results that can be used as inputs for subsequent calculations. These values are automatically skipped at commit time.

Dummy members must be identified with a leading pound (#) sign. For example:

Example Example

*REC(ACCOUNT = #TEMP)

End of the example.

Account #TEMP does not exist in the account dimension. The generated record can be used somewhere else in the rules, but its value is not stored in the database.

Example Example

*WHEN ACCOUNT.FLAG

*IS = Y

*REC(ACCOUNT=#TEMP)

*ENDWHEN

*GO

*WHEN ACCOUNT

*IS #TEMP

*REC(FACTOR=GET(ACCOUNT=MULTIPLIER),ACCOUNT=FINAL)

*ENDWHEN

End of the example.

The above technique could be used in an allocation procedure, requiring the calculation of the total value of the coefficient to use in the allocation process. Alternatively, you could calculate an opening balance amount that does not need to be stored in the database.

The dummy members generated with this technique do not exist in any dimension. For this reason, it is not possible to assign to them properties that could be used in the rules. They can only be referenced using their ID.

Using memory variables in WHEN / ENDWHEN instructions

When a memory variable represents a real member of a dimension, you can now access its properties in a WHEN / ENDWHEN structure.

The logic may use the properties of a valid memory variable in evaluating a WHEN criteria as well as in the definition of a destination member.

The following example uses the property of a memory variable to read an aggregated value from a parent and transfer it into a base level member whose ID is stored in a parent’s property:

Example Example

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

// create the memory variables (in this case the parents in H1, for example #SALES, #WORLDWIDE1)

*CALC_DUMMY_ORG ENTITY=PARENTH1

// Some parent might have a corresponding input member specified in a property

*WHEN ENTITY.INPUTMEMBER

*IS<>””

*REC(ENTITY=ENTITY.INPUTMEMBER)

*ENDWHEN

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

End of the example.

Similarly, it is now possible to access the value of a memory variable from a GET instruction, using the syntax shown in the following example:

Example Example

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

*XDIM_MEMBER ACCOUNT=SQ_FEET

// create the memory variables

*CALC_DUMMY_ORG ENTITY=PARENTH1

// Calculate the allocation factor of each base member (note # used to identify the dummy parent)

*WHEN ENTITY.ISBASEMEM

*IS=”Y"

*REC(FACTOR=1/GET(ENTITY=# + ENTITY.PARENTH1) * 100,

ACCOUNT=PCT_SQ_FEET)

*ENDWHEN

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

End of the example.

If the base-level members have many levels of parents, it is also possible to specify the number of levels to ascend, in the search for the value of a “parent” member. The syntax is:

GET(dimension=dimension.property (number of levels) )

The example below is a search performed in a parent that is 4 levels above current member. Note that this example does not use memory variables, because the parents in the stored hierarchy PARENTS1 are actually stored (in fact the function used is CALC_ORG and not CALC_DUMMY_ORG).

Example Example

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

*XDIM_MEMBER ACCOUNT=SQ_FEET

// Calculate the parents to store

*CALC_ ORG ENTITY=PARENTS1

// Calculate the allocation factor of each base member having 4 levels of parents above

*WHEN ENTITY.PARENTS1

*IS<>””

*REC(FACTOR=1/GET(ENTITY=ENTITY.PARENTS1(4)) * 100, ACCOUNT=PCT_SQ_FEET)

*ENDWHEN

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

End of the example.