dbTalk Databases Forums  

Ordering (reverse)

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


Discuss Ordering (reverse) in the microsoft.public.sqlserver.olap forum.



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

Default Ordering (reverse) - 08-19-2005 , 06:39 AM






I am just getting members from Jan to Dec.

Jan , Feb , March , April , ..... Dec

Problem :
Can i get them in Reverse order ?

Dec, Nov, Oct , .... Jan

I want to ask that using Order Funtion in MDX can i get these members
in reverse order . For this prupose what criteria i should provide in
the Order Function.


Thanks in advance.

Faraz


Reply With Quote
  #2  
Old   
Imtiaz Ullah
 
Posts: n/a

Default Re: Ordering (reverse) - 08-19-2005 , 07:49 AM






I;m not sure if there is an MDX command for this, there may be, but i can
think of a different way for this.
You could create your own SORTORDER column in your dimension and then order
by that?
i.e.
Month SortOrder
December 1
November 2
....
Regards
Immy

"Faraz" <ahmed.faraz1 (AT) gmail (DOT) com> wrote

Quote:
I am just getting members from Jan to Dec.

Jan , Feb , March , April , ..... Dec

Problem :
Can i get them in Reverse order ?

Dec, Nov, Oct , .... Jan

I want to ask that using Order Funtion in MDX can i get these members
in reverse order . For this prupose what criteria i should provide in
the Order Function.


Thanks in advance.

Faraz




Reply With Quote
  #3  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Ordering (reverse) - 08-20-2005 , 02:32 AM



This Foodmart Sales sample uses the Rank() function:

Quote:
With Set [MonthRange] as
'Descendants([Time].[1997], [Time].[Month])'
select {[Measures].[Unit Sales]} on columns,
Order([MonthRange],
Rank([Time].CurrentMember,[MonthRange]),
BDESC) on rows
from Sales
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


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.