Using Member Properties in Calculated Measures -
05-04-2005
, 02:59 PM
I need an MDX expression that will return a Number of Inspections per
Day. My cube contains a [Number of Inspections] measure that will
return the number for the current member of the time dimension, which
is named Period. Period contains a [Year Num] level and a [Period Name]
level (which is keyed to the month).
With the data only on the month level of detail, I must derive
Inspections per Day by dividing the number of inspections by the number
of working days in the period. To do this, I have created a field in
the relation table behind the Period dimension to store the number of
working days in each period. I created an additional field to store the
number of working days in the year. In this field, I just put the total
working days per year so all periods in 2004 have 262; The records in
2005 have 85 for the number of working days from Jan to Apr. This let
me create Member Properties on the Period and Year levels. I named them
both "Working Days". This worked great. I can create a Calculated
Measure that gives me back this value. Its expression is:
[Period].CurrentMember.Properties("Working Days")
I thought this would be the hard part. One would think that I could
then create another Calculated Measure that divided [Nbr of
Inspections] / [Nbr of Working Days] for my final result. But I get
#ERR in every cell.
Can anybody see what I'm doing wrong?
The only other thing of note is that there is sparsity in the [Nbr of
Inspections] measure. There is another dimension named Inspector. If an
Inspector did not do any inspections in a certain month, then those
cells are empty.
Any ideas would be appreciated.
-David |