Home > Working with Planning Projects > Building an Application > Building Application Models > Building A Cube Model > Measure Settings > Cross Referencing Measures > Cross Referencing to Another Model Cube
Cross Referencing to Another Model Cube
Last Updated 2/29/2012 7:15 PM
The syntax for referencing a measure in another model is identical to that described in the section 'Cross Referencing Within The Same Model', except that we prefix the expression with the name of the model we are referencing.
Note that if the referenced model name contains spaces, these should be replaced with the underscore '_' character.
Referencing a measure in another model is straightforward if the dimension names are the same (for example, the Product dimension is the same in both models).
This is because the Cascade calculation engine will match the dimensions if they have the same name, even if they are in a different order.
This works well if your calculation expression needs to refer to a measure where the dimension members are the same in both models.
So, for example, if our current model (the model we are writing the expression for) has dimensions Product and Country, and we wish to refer to the 'Price' measure, which is held in our Standard Prices model, and assuming the Standard Prices mdoel has Product and Country dimensions, we can write the expression as follows:
Standard_Prices.'Price'
We don't need to specifiy the Country or Product dimension as they are the same.
This will work just as well if the model we are referencing has less dimensions than the current model.
For example, let's suppose that our Standard Prices model did not have a Country dimension (perhaps the prices are standard across all countries).
We can use the same expression:
Standard_Prices.'Price
and the expression will work, just matching on the current Product name to ensure the correct 'Price' measure is retrieved.
The dimension order becomes important again if any of the following exist:
- We wish to select a specific member of a dimension.
- The dimension names for dimensions we want to match on are different (e.g. Country and Location).
- The cube we are referencing has more dimensions than our current model.
If any of the above criteria are true, then it becomes necessary to use the numbered dimension names to ensure the expression refers to the correct dimension members.
Remember that the variable dimension1 through dimension(n) refer to the model currently being calculated, and that our reference expression should obey the order of the dimensions in the cube being referenced.
EXAMPLE 1:
The current model, Revenue, contains the dimensions City and Brand. The dimension order for this model is:
Dimension 1 - Version
Dimension 2 - City
Dimension 3 - Brand
Dimension 4 - Measure
The model we are referencing is Property, which contains dimensions Brandname and City. The dimension order for this model is:
Dimension 1 - Version
Dimension 2 - Brandname
Dimension 3 - City
Dimension 4 - Measure
We wish to reference the measure 'No Units' from the Property model where City=City and Brand=Brandname.
The expression needs to be written taking into account the order of the model we are referencing, but using the variable names for the model we are calculating.
In this example, the City is contained in the variable dimension2 and the Brand is contained in the variable dimension3. By using those values to reference the correct members in the referenced model, our expression is:
Property.dimension3.dimension2.'No Units'
In our expression we don't worry about Version as it is to the left of the reference and is the same in both models (note that the model name is not taken into account when we refer to a dimension being "to the left of the expression").
Next is the second dimension of the referenced model (Brandname) which is referenced by using the variable dimension3 which contains the current member name of the Brand dimension from the model being calculated (the current model).
Finally, the third dimension of the referenced model (City), for which we specify the variable dimension2 which is the current member of City dimension for the model we are calculating.
Example 2:
The current mdoel, Revenue, contains the dimensions City and Brand. The dimension order for this model is:
Dimension 1 - Version
Dimension 2 - City
Dimension 3 - Brand
Dimension 4 - Measure
The model we are referencing is Property, which contains dimensions Brandname, Category and City. The dimension order for this model is:
Dimension 1 - Version
Dimension 2 - Brandname
Dimension 3 - Category
Dimension 4 - City
Dimension 5 - Measure
We wish to reference the measure 'No Units' from the Property model where City = City and Brand = Brandname and Category = 'Leasehold'.
As with Example 1, the city is contained in the variable dimension2 and the Brand is contained in the variable dimension3. However, we want to reference the measure for the 'Leasehold' Category. So our expression in this case is:
Property.dimension2.'Leasehold'.dimension2.'No Units'
Note that in this example, the variable dimension2 (current model City member) is used in the position for dimension4 position for the referenced model.
See also
|