dbTalk Databases Forums  

Changing order of descendants result

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


Discuss Changing order of descendants result in the microsoft.public.sqlserver.olap forum.



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

Default Changing order of descendants result - 10-27-2005 , 12:32 AM






Hi,

I'm a newbie to MDX and have the following problem.

I use the following statement

SET [CustomTimeSet] AS 'Descendants([Time].[2006].[Quarter
1]:[Time].[2006].[Quarter 4],[Time].[Month] ,SELF_AND_BEFORE)'

and it is returning the data that I require. However it returns data in
q1,m1,m2,m3,q2,m4,m5,m6 order. I want it to return the data in
m1,m2,m3,q1,m4,m5,m6,q2 order.


This is very trivial but I need the data in that format.

Thanks In Advance,
Darshan


Reply With Quote
  #2  
Old   
Denny Lee
 
Posts: n/a

Default Re: Changing order of descendants result - 10-27-2005 , 12:58 AM






Hmm - you could always do something like this:
SET [CustomTimeSet] AS '
{
Descendants([Time].[2006].[Quarter 1], [Time].[Month], SELF),
[Time].[2006].[Quarter 1],
Descendants([Time].[2006].[Quarter 2], [Time].[Month], SELF),
[Time].[2006].[Quarter 2]
}'

Because of the hierarchical structure of the time dimension, quarter is
higher than month hence it will come in before the months when using a
function like descendants.

--
HTH!
Denny Lee
<dennyglee_at_hotmail_dot_com>

Blog at:: http://spaces.msn.com/members/denster/



"Darshan" <janitor (AT) gmail (DOT) com> wrote

Quote:
Hi,

I'm a newbie to MDX and have the following problem.

I use the following statement

SET [CustomTimeSet] AS 'Descendants([Time].[2006].[Quarter
1]:[Time].[2006].[Quarter 4],[Time].[Month] ,SELF_AND_BEFORE)'

and it is returning the data that I require. However it returns data in
q1,m1,m2,m3,q2,m4,m5,m6 order. I want it to return the data in
m1,m2,m3,q1,m4,m5,m6,q2 order.


This is very trivial but I need the data in that format.

Thanks In Advance,
Darshan




Reply With Quote
  #3  
Old   
Darshan
 
Posts: n/a

Default Re: Changing order of descendants result - 10-27-2005 , 01:09 AM



Thanks denny, although your solution does give the data in the desired
format I will need to specify a range i.e. Quarter 1 to Qaurter 3


Reply With Quote
  #4  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: Changing order of descendants result - 10-27-2005 , 04:40 AM



try this:

Quote:
Hierarchize( Descendants([Time].[2006].[Quarter 1]:[Time].[2006].
[Quarter 4],[Time].[Month] ,SELF_AND_BEFORE), POST)
Quote:

--
Regards
Darren Gosbell [MCSD]
<dgosbell_at_yahoo_dot_com>
Blog: http://www.geekswithblogs.net/darrengosbell

In article <1130391166.478213.207520 (AT) g14g2000cwa (DOT) googlegroups.com>,
janitor (AT) gmail (DOT) com says...
Quote:
Hi,

I'm a newbie to MDX and have the following problem.

I use the following statement

SET [CustomTimeSet] AS 'Descendants([Time].[2006].[Quarter
1]:[Time].[2006].[Quarter 4],[Time].[Month] ,SELF_AND_BEFORE)'

and it is returning the data that I require. However it returns data in
q1,m1,m2,m3,q2,m4,m5,m6 order. I want it to return the data in
m1,m2,m3,q1,m4,m5,m6,q2 order.


This is very trivial but I need the data in that format.

Thanks In Advance,
Darshan



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.