• Hi Robin,

    Actually I don't think that is working.

    What your result should be is the same figure 3 times. It would if you wrote the query like this:

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

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

    SELECT

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

    [Order Date].[CalendarHierarchy].[Year].&[2006] ON 1

    FROM

    MyFirstCube

    Because you are not specifying a measure in your sub cube, it is taking the default measure of your cube (typically the first measure in the first measure group in your designer) which in your case may not be [Sales Amount].

    To specify the min and the max of the current member is sort of meaningless unless you specify a level.

    For example the code on this page returns the maximum monthly sales for each quarter, subcategory, and country in the Adventure Works cube:

    WITH MEMBER Measures.x AS Max

    ([Date].[Calendar].CurrentMember.Children

    , [Measures].[Reseller Order Quantity]

    )

    SELECT Measures.x ON 0

    ,NON EMPTY [Date].[Calendar].[Calendar Quarter]*

    [Product].[Product Categories].[Subcategory].members *

    [Geography].[Geography].[Country].Members

    ON 1

    FROM [Adventure Works]

    It's using .currentmember.children so it is looking at the children of [Date].[Calendar].[Calendar Quarter] which are months so it's meaningful (it displays the total sales for the most successful month). Without the .children it would just display a total for the quarter in which case there would be no point in having a calculation at all.

    I hope this helps 🙂


    I'm on LinkedIn