ReferenceLevelLocationShiftLight

This post-processor shifts an underlying measure to an upper location to perform comparisons. It works with the IReferenceLevelContextVal context value to define the reference level.

Definition

ReferenceLevelLocationShiftLight
        .measure()
        .withUnderlyingMeasure(value)
        .withType(ILiteralType.DOUBLE)
        .as("reference")
        .publish(context);

injectAll(IReferenceLevelsAware.class, List.of(null, "L1@H1", "L2@H1"));

Here are the parameters of the measure function:

Parameters Type Mandatory Usage
underlyingMeasure CopperMeasure 1 The underlying measure that is copied to this metric.
type String 1 The measure type, one of the ILiteralType define.

Context values

The context value must also be set up by injecting the list of available reference levels as shown on the example. It is filled with a list of level strings that will be displayed to the user. The list must have the following unambiguous format: “level@hierarchy@dimension”, “level@hierarchy” or “level”.

  • Reference levels: The reference levels should be injected after the metric is created because the context value is only registered once the metric is defined.
  • Top level: The Top level is also added by default to the selectable levels, it is named “Enterprise”, it is selected with a null or empty value.
  • UI display name: The UI name of the context value is “ReferenceLevel”.

Behavior

If the user selects “L1@H1” as a reference level:

  • All the locations with H1 above L1 will return empty cells.
  • The locations with H1 equal to or below L1 will return the value of L1.
  • The hierarchies other than H1 will be reset to the level 0 value.

Example

If we have H1:AllMembers/L1/L2, H2:AllMembers/L1, H3:L1/L2, the location shifts for the “L1@H1” as a reference level will be as follows:

  • H1/AllMembers,H2/L1,H3/L1 => empty
  • H1/L1,H2/L1,H3/L1 => H1/L1,H2/AllMembers,H3/L1
  • H1/L2,H2/L1,H3/L1 => H1/L1,H2/AllMembers,H3/L1
  • H1/L2,H2/L1,H3/L2 => H1/L1,H2/AllMembers,H3/L1