THE SQL Server Blog Spot on the Web
Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | Join | Help
in Search

Row with calculated members is missing (MDX)

Last post 08-13-2008, 5:56 by Marco Russo (SQLBI). 1 replies.
Sort Posts: Previous Next
  •  07-15-2008, 6:49 7850

    Row with calculated members is missing (MDX)

    Hi,

    I need to generate MDX statement which returns a total row with the sums of all columns. I wrote the following MDX, but the row with calculated members is missing in the result. This happens only when I use in rows two alternate hierarchies of one dimension (in this case the Product dimension). How could I rewrite this MDX to get it working? I could not use the all members, because both hierarchies used to be filtered in my real project.

    with
    member [Product].[Category].[Total 1] as
    sum([Product].[Category].Levels(1).AllMembers)
    member [Product].[Product Categories].[Total 2] as
    sum([Product].[Product Categories].Levels(3).AllMembers)

    select
    {
    ([Product].[Category].[Total 1], [Product].[Product Categories].[Total 2]),
    {[Product].[Category].Levels(1).AllMembers * [Product].[Product Categories].Levels(3).AllMembers}
    } on rows,
    [Measures].[Internet Gross Profit] on columns
    from [Adventure Works]

    Best regards,

    Peter 

     

  •  08-13-2008, 5:56 8348 in reply to 7850

    Re: Row with calculated members is missing (MDX)

    Uhm, what is exactly the result you want to see?

    You are projecting tuples on rows, where each row has a combination of the two hierarchies you are cross-joining. The calculated members are valid for each single hierarchy, but what do you want to see as a result of the tuple (Total 1, Total 2) ? The sum of the two members?

    Marco


    http://www.sqlbi.eu
Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement