Results 1 to 3 of 3

Thread: Max function

  1. #1
    Join Date
    Apr 2009
    Posts
    2

    Max function

    I have read (and re-read) the series of articles about the MAX function, and I almost have it working. But the following gives me a total across the 3 countries, rather than the maximum of any of the 3. What am I doing wrong?

    WITH MEMBER
    [customer].[country].[High Sales] AS
    'Max([customer].[Country].members ,
    [unit sales] )'
    SELECT
    { ([unit sales],[customer].[Country].children ) ,
    ([unit sales],[customer].[country].[High Sales]) }
    on columns ,
    non empty [Product].[Product family].children ON rows
    FROM [warehouse and sales]

    It must be in my numeric expression, the 2nd argument of the MAX function.

  2. #2
    Join Date
    Apr 2009
    Posts
    2

    MAX Function

    OK got it now ...

    WITH MEMBER
    [customer].[country].[High Sales] AS
    'Max([customer].[Country].[country].members ,
    measures.[unit sales] )'
    SELECT
    { ([unit sales],[customer].[Country].children )
    ,([unit sales],[customer].[country].[High Sales]) }
    on columns ,
    non empty [Product].[Product family].children ON rows
    FROM [warehouse and sales]

    I needed [country] twice in the set of the MAX function, but only members, not children. But I wanted children in the columns, because I did not want the ALL.

  3. #3
    Join Date
    Jun 2004
    Location
    Atlanta and Manhattan
    Posts
    607

    Gotta Watch Those Hierarchies ...

    Easy enough to miss if you started on AS2k or earlier ...

    But thanks a lot for posting your solution. It may benefit others having similar woes ...

    Good Luck.

    Bill

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •