Help with SSAS measure MDX script!


  • Hi,

    I have simple problem.

    I created following MDX script:

    SUM ( { [Time].[Year Name].PrevMember
    , [Time].[Year Name].CurrentMember }
    , [Measures].[Quantity]

    The script I want should count current state for time dimension.

    But it gave me wrong numbers in result.

    I am sending picture of cube for better understanding.

    Columns marked in green rectangule are counted good, but colums marked with brown are wrong.

    In Cal 2005 didnt count state of Cal 2002 because it is counting state from Cal 2003, where are no data.
    Cal 2009 didnt count good because it didnt add -4 to currentstate from Cal 2008.

    Can anyone help me with optimizing my MDX script, please ?


    čtvrtek 14. ledna 2010 16:20


  • Hi,

    this is not an MDX script - it is an expression. And it does exactly what you want - sums Quantity from current and previous year. If you want to get numbers expressing stock quantity, use LastNonEmpty aggregation function for your measure. Try to better describe, what you want to achieve (use Czech if you prefer).


    středa 20. ledna 2010 0:29