dbTalk Databases Forums  

Ordering members in set in relation to their position in hierarchy

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


Discuss Ordering members in set in relation to their position in hierarchy in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
arcticpuppy@gmail.com
 
Posts: n/a

Default Ordering members in set in relation to their position in hierarchy - 12-28-2004 , 02:22 AM






Hi

I need to create a set that returns the parallelperiods for a number of
time members. I create this set like this:

{{[Time].[All Time].[2004].[Q 1 04], [Time].[All Time].[2004].[Q 2 04],
[Time].[All Time].[2004].[Q 3 04]},
GENERATE({[Time].[All Time].[2004].[Q 1 04], [Time].[All
Time].[2004].[Q 2 04], [Time].[All Time].[2004].[Q 3 04]},
{parallelperiod([Tid].[Years], 1)})}

Which gives me:
Q1 04, Q2 04, Q3 04, Q1 03, Q2 03, Q3 03

I need this set to be ordered like this:
Q1 04, Q1 03, Q2 04, Q2 03, ...
Anyone got any ideas how i can accomplish this?


Reply With Quote
  #2  
Old   
Brian Altmann
 
Posts: n/a

Default RE: Ordering members in set in relation to their position in hierarchy - 12-28-2004 , 06:31 AM






Try:

{GENERATE({[Time].[All Time].[2004].[Q 1 04], [Time].[All
Time].[2004].[Q 2 04], [Time].[All Time].[2004].[Q 3 04]},
{Time.Currentmember,parallelperiod([Tid].[Years], 1)})}

HTH,
Brian
www.geocities.com/brianaltmann/olap.html

"arcticpuppy (AT) gmail (DOT) com" wrote:

Quote:
Hi

I need to create a set that returns the parallelperiods for a number of
time members. I create this set like this:

{{[Time].[All Time].[2004].[Q 1 04], [Time].[All Time].[2004].[Q 2 04],
[Time].[All Time].[2004].[Q 3 04]},
GENERATE({[Time].[All Time].[2004].[Q 1 04], [Time].[All
Time].[2004].[Q 2 04], [Time].[All Time].[2004].[Q 3 04]},
{parallelperiod([Tid].[Years], 1)})}

Which gives me:
Q1 04, Q2 04, Q3 04, Q1 03, Q2 03, Q3 03

I need this set to be ordered like this:
Q1 04, Q1 03, Q2 04, Q2 03, ...
Anyone got any ideas how i can accomplish this?



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.