dbTalk Databases Forums  

MDX Query getParentChild members at each level

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss MDX Query getParentChild members at each level in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
pavan
 
Posts: n/a

Default MDX Query getParentChild members at each level - 09-20-2005 , 04:44 AM






I want to retrieve the parent-child string at each level for a
dimension.

Now i have the following query using foodmart,budget cube

WITH
MEMBER [MEASURES].[MEMBNAME] as '
Space([Time].CurrentMember.level.ordinal*5) +
[Time].CurrentMember.Name'
MEMBER [MEASURES].[LEVEL] as '[Time].CurrentMember.level.ordinal'
MEMBER [MEASURES].[LEVELNAME] as '[Time].CurrentMember.level.name'
MEMBER [MEASURES].[ALLEVELNAME] as '[Time].CurrentMember.lead(2)'

Select
{
[MEASURES].[MEMBNAME]
,[MEASURES].[LEVEL]
,[MEASURES].[LEVELNAME]
}
on columns,
{[Time].members} on rows
from budget

This query gives the members for this dimension at each level.
Basically hierachial.
Query results is below,



MEMBER NAME LEVEL NAME LEVEL
1997 Year 0
Q1 Quarter 1
1 Month 2
2 Month 2
3 Month 2
Q2 Quarter 1
4 Month 2
5 Month 2
6 Month 2
Q3 Quarter 1
7 Month 2
8 Month 2
9 Month 2
Q4 Quarter 1
10 Month 2
11 Month 2
12 Month 2
1998 Year 0
Q1 Quarter 1
1 Month 2
2 Month 2
3 Month 2
Q2 Quarter 1
4 Month 2
5 Month 2
6 Month 2
Q3 Quarter 1
7 Month 2
8 Month 2
9 Month 2
Q4 Quarter 1
10 Month 2
11 Month 2
12 Month 2




Now i need to add another column which returns a entire parent
hierarchy at each level.
Ex; at
1 Month 2 row i need a string ='1997*q1*1'
2 Month 2 row i need a string ='1997*q2*2'


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.