• Hi Robin,

    I think everyone's MDX journey is a little like that 😀

    The problem you are having is because what you are asking MDX to display is the minimum/maximum of all year members in the hierarchy, not just the member that is displaying. So your second query is technically correct. It's saying in 2006 the sales amount was 6530343 but the minimum amount looking at all the year members at the year level is 3266374 and the maximum amount looking at all the year members at the year level is 9791060.

    It all depends on what you are trying to achieve. For example let's say a calendar hierarchy is Year>Quarter>Month>Week>Day. You could do something like

    WITH MEMBER [Measures].[MinValue] AS MIN([Order Date].[CalendarHierarchy].CURRENTMEMBER.CHILDREN, [Measures].[Sales Amount]), FORMAT_STRING = '0'

    MEMBER [Measures].[MaxValue] AS MAX([Order Date].[CalendarHierarchy].[Year].CURRENTMEMBER.CHILDREN, [Measures].[Sales Amount]), FORMAT_STRING = '0'

    SELECT

    {[Measures].[Sales Amount],[Measures].[MinValue],[Measures].[MaxValue]} ON 0,

    [Order Date].[CalendarHierarchy].[Year].Members ON 1

    FROM

    (

    SELECT [Order Date].[CalendarHierarchy].[Year].[2006] ON 0

    FROM MyFirstCube

    )

    This would give you the sales amount for the lowest and highest performing Quarters in 2006.

    Like I say though, it all depends on what you are trying to get out of the query.

    I hope this clarifies things a bit 🙂


    I'm on LinkedIn