OnChange Instructions

OnChange instructions are used in formulas for roll-up or roll-down operations, where changes from blocks at one sparse level are propagated to blocks at another sparse level.

The following roll-down formula computes a percentage of the Forecast Units in the parent member and adds that value to the Forecast Units in the child member. This happens along a sparse dimension. In other words, the value is allocated to different children using a percentage.

"Forecast Units" = "Forecast Units" + pctof(ProductAllocation.percentage, deltaValue(source("Forecast Units")))

OnChange instructions include:

deltaValue

deltaValue returns the delta value of a changed entry at the specified location. The changes are stored in change entries as old, new and deltas. deltaValue is applicable only to change entries or “onChange” formulas.

deltaValue(Location location)

dependencyAttribute

dependencyAttribute returns the value of the attribute in the dependency between sourceMember and the corresponding target member in the block currently processed along the dimension. The sourceMember in the dimension for the current operation is determined from a block or a change entry.

dependencyAttribute(Dimension d, String attributeName)

isInSourceScope

isInSourceScope checks whether the specified location in a roll-up or roll-down operation is in the slice represented by the operation's source object. For roll-up, the source is inferred as the child, and for roll-down the source is inferred as the parent. isInSourceScope is applicable only in roll-up or roll-down operations where changes are propagated from a source object.

isInSourceScope(Location location)

newValue

newValue returns the new value of a changed entry at the specified location. The changes are stored in change entries as old, new and deltas. newValue is applicable only to change entries or “onChange” formulas.

newValue(Location location)

oldValue

oldValue returns the old value of a changed entry at the specified location. The changes are stored in change entries as old, new and deltas. oldValue is applicable only to changed entries or “onChange” formulas.

oldValue(Location location)

source

source returns the source of the specified location. The location is cast into a source location, and the value for that location is fetched from the appropriate place. For example, the value of “location” is the value from the current block data cell, whereas the value of “source(location)” is the value from the location with the member replaced by its corresponding source member along the dimension on which roll-up or roll-down is performed. source is applicable only in roll-up or roll-down operations where changes are propagated from a source object.

source(Location loc)

sourceMember

sourceMember takes the current location in the current context and the source object (block or a change entry) and determines the member in source object along the given dimension. sourceMember is applicable only in roll-up or roll-down operations where changes are propagated from a source object.

sourceMember(Dimension d)

sourceSparseMember

sourceSparseMember takes the current location in the current context and the source object (block or a change entry) and determines the member in the source object along the given sparse dimension. sourceSparseMember is applicable only in roll-up or roll-down operations where changes are propagated from a source object.

sourceSparseMember(Dimension d)