in

Prologika Forums

Business Intelligence to the Masses
Latest post 05-27-2008 8:25 AM by tlachev. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-26-2008 9:12 AM

    • ARupp
    • Top 200 Contributor
    • Joined on 05-26-2008
    • Posts 1

    MDX Query with Parent-Child Dimension

    I wish to create an MDX Query that will bring back all the members of a parent-child dimension irrespective of what level they may be in 1 column.

     If i run the below query:

    select
    {Descendants([SummaryGLAccount].[SKParentAccountID].[Level 02].ALLMEMBERS)} on 1,
    {[Measures].[GLAcctName], [Measures].[ReportActual],[Measures].[ReportBudget],[Measures].[BudgetVariance] } on 0
    from
    [RepFinance]
    where ([SummaryGLAccount].[SummaryReport].&[1] , [Date].[Financial].[Fin Period].&[200902])

    it brings back a column for every level in the hierarchy, to combat this I could create an calculated member like this:

    iif([SummaryGLAccount].[SKParentAccountID].Currentmember.Level.Name = "Level 05" ,
       iif([SummaryGLAccount].[SKParentAccountID].CurrentMember is null,
         null,
         [SummaryGLAccount].[SKParentAccountID].CurrentMember.Name),
     iif([SummaryGLAccount].[SKParentAccountID].Currentmember.Level.Name = "Level 04" ,
       iif([SummaryGLAccount].[SKParentAccountID].CurrentMember is null,
         null,
         [SummaryGLAccount].[SKParentAccountID].CurrentMember.Name),
    null))

    which will work for what I want to do, my question is... is there a better way?

     


     

  • 05-27-2008 8:25 AM In reply to

    Re: MDX Query with Parent-Child Dimension

    Not sure why this query would bring back a column for each level. Can you repro it against the Adventure Works cube? The following query brings back all employees in a single column:

    select non empty {[Measures].[Reseller Sales Amount],[Measures].[Reseller Tax Amount]} on 0,

    Non Empty {Descendants ([Employee].[Employees].[Employee Level 02].ALLMEMBERS)} on 1

    from [adventure works]

    where [Date].[Calendar].[Month].&[2003]&[3]

Page 1 of 1 (2 items)
Copyright © 2005 Prologika, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems