• msmithson (1/31/2013)


    I'm new to SSAS so bear with me.

    I have a calculated measure based on an attribute in one of my dimensions. The calculation looks like this:

    CREATE MEMBER CURRENTCUBE.[Measures].[Office Visits]

    AS sum(EXISTING({[Location].[Place of Service].&[11]}), [Measures].[Encounters]),

    FORMAT_STRING = "Standard",

    NON_EMPTY_BEHAVIOR = { [Encounters] },

    VISIBLE = 1 , ASSOCIATED_MEASURE_GROUP = 'Encounters'

    It calculates correctly when I browse by Place of Service but when I try to browse by another attribute of that Location dimension "LocationName" then the calculated measure value just repeats for each LocationName. I'm sure this must have something to do with attribute relationships or the hierarchy but I just don't understand the behavior here. :blink:

    Well after re-reading a chapter on MDX scripting and cube navigation I learned enough to figure out what was happening. This calculation was aggregating at the [Place of Service] level of the hierarchy but not the children. Changed it to this and it worked:

    CREATE MEMBER CURRENTCUBE.[Measures].[Office Visits]

    AS sum(EXISTING({([Location].[Place].[Place Of Service].&[11].Children)}, [Measures].[Encounters])),

    FORMAT_STRING = "Standard",

    NON_EMPTY_BEHAVIOR = { [Encounters] },

    VISIBLE = 1 , ASSOCIATED_MEASURE_GROUP = 'Encounters' ;

    :w00t: