Database Reference
In-Depth Information
The MDX expression used in a
MeasureExpression
property must be in the
form
M1 op M2
, where the operator
op
can be only
*
or
/
. M1 and M2 must be
measures from different measure groups, with the condition that these measure
groups share at least one common dimension. In our example, we have two
dimensions that are used by both measure groups: one is Date and the other is
Currency (which has a many-to-many relationship). We can use the following
expression in the
MeasureExpression
property of the
Amount
measure:
Amount / Rate
The
MeasureExpression
is not recursive: when the MDX expression refers to
Amount in the division, it will use the raw value of the Amount measure before
any MDX Script calculations have taken place. The Rate measure in the expression
contains the exchange rate value stored in the Exchange Rate measure group. The
calculation will take place at the Date and Currency granularity and the result will
then be summed up to higher levels of granularity.
The
MeasureExpression
expression is evaluated before the calculations
in the MDX Script are evaluated. Thus, if you perform a calculation in the
MDX Script on a measure that has its
MeasureExpression
property set,
the value of that measure will have already been changed as a result of
the calculation of the measure expression.
At query time the results we get are identical to the ones we obtained in the first
example in this chapter, as we can see in the following screenshot:
Search WWH ::
Custom Search