MDX simple concept question

  • As near as I can tell from documentation, the Descendants() function returns a set.

    This returns a set of 1,500+ product names.

    SELECT

    { } ON COLUMNS,

    {Descendants([Product].CurrentMember, [Product].[Product Name])} ON ROWS

    FROM [Sales and Warehouse];

    Then why doesn't this return the same set of 1,500+ product names? I only get the one item "Set Of Products".

    WITH MEMBER [Set Of Products] AS

    { Descendants([Product].CurrentMember, [Product].[Product Name]) }

    SELECT

    { } ON COLUMNS,

    { ([Set Of Products])} ON ROWS

    FROM [Sales and Warehouse]

    And if I try using StrToSet, it complains that it isn't a set (The function expects a tuple set expression for the 1 argument. A string or numeric expression was used.)

    WITH MEMBER [Set Of Products] AS

    { Descendants([Product].CurrentMember, [Product].[Product Name]) }

    SELECT

    { } ON COLUMNS,

    { SetToStr(( [Set Of Products] ))} ON ROWS

    FROM [Sales and Warehouse]

    So, my calculated measure must not be a set.

    Can someone shed some light?

    Thanks,

    Rob

  • A member is one thing - one product or the sum/avg of a set of products

    You need to define your set as a set as below - a set being a collection of members

    WITH Set [Set Of Products] AS { Descendants([Product].CurrentMember, [Product].[Product Name]) }SELECT { } ON COLUMNS, { ([Set Of Products])} ON ROWSFROM [Sales and Warehouse]

    Make sense?

    Mack

  • Mackers (3/14/2013)


    A member is one thing - one product or the sum/avg of a set of products

    You need to define your set as a set as below - a set being a collection of members

    WITH Set [Set Of Products] AS { Descendants([Product].CurrentMember, [Product].[Product Name]) }SELECT { } ON COLUMNS, { ([Set Of Products])} ON ROWSFROM [Sales and Warehouse]

    Make sense?

    Mack

    Makes perfect sense!!

    Thank you very much!

    Rob

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply