dbTalk Databases Forums  

Sorting on only one Column in MSOLAP

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


Discuss Sorting on only one Column in MSOLAP in the microsoft.public.sqlserver.olap forum.



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

Default Sorting on only one Column in MSOLAP - 07-14-2003 , 10:35 AM






I have what I thought would be a simple query, which is attached below:


select
{[Measures].[No of Clients],
[Measures].[Cash],
[Measures].[Bonds],
[Measures].[Mutual Funds],
[Measures].[Total Assets],
[Measures].[Total Liabilities]} on columns,
non empty ({[Primary SalesRep].[primary Sales Rep].members}) on rows
from RPT2X
where
([Time].[Apr 2003],
[Company].[New York]
)

I need to be able to sort on the [Measures].[Total Assets] column, and
nothing else. I can see how to do it if I want to sort on everything in
all columns, but I just need one column sorted.

Does anyone have a simple answer to this? Thanks.


Reply With Quote
  #2  
Old   
Sean Boon [MS]
 
Posts: n/a

Default Re: Sorting on only one Column in MSOLAP - 07-14-2003 , 12:50 PM






Hi Duane,

You need to use the ORDER() MDX function. Something like

non empty (ODER({[Primary SalesRep].[primary Sales Rep].members},
[Measure].[Total Assets], DESC)) on rows
Quote:
from RPT2X
Sean

--
Sean Boon
SQL Server BI Product Unit

Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.

"Daune Kramer" <daune (AT) riverlooksoftware (DOT) com> wrote

Quote:
I have what I thought would be a simple query, which is attached below:


select
{[Measures].[No of Clients],
[Measures].[Cash],
[Measures].[Bonds],
[Measures].[Mutual Funds],
[Measures].[Total Assets],
[Measures].[Total Liabilities]} on columns,
non empty ({[Primary SalesRep].[primary Sales Rep].members}) on rows
from RPT2X
where
([Time].[Apr 2003],
[Company].[New York]
)

I need to be able to sort on the [Measures].[Total Assets] column, and
nothing else. I can see how to do it if I want to sort on everything in
all columns, but I just need one column sorted.

Does anyone have a simple answer to this? Thanks.




Reply With Quote
  #3  
Old   
Daune Kramer
 
Posts: n/a

Default Re: Sorting on only one Column in MSOLAP - 07-14-2003 , 01:50 PM



Hi Sean -

Thanks

One question - my MDX is kicking out the [Total Assets]. Since I specify
[Total Assets] in my columns, does it prevent me from using it in an
order statement on the rows?

"Sean Boon [MS]" <seanboon (AT) online (DOT) microsoft.com> wrote in
news:OkGdbBjSDHA.1868 (AT) TK2MSFTNGP11 (DOT) phx.gbl:

Quote:
Hi Duane,

You need to use the ORDER() MDX function. Something like

non empty (ODER({[Primary SalesRep].[primary Sales Rep].members},
[Measure].[Total Assets], DESC)) on rows
from RPT2X

Sean




Reply With Quote
  #4  
Old   
Sean Boon [MS]
 
Posts: n/a

Default Re: Sorting on only one Column in MSOLAP - 07-15-2003 , 12:20 PM



Nope. Shouldn't matter. I noticed that Total Assets is referred to
incorrectly. I forgot the "S" in Measures.

Sean


--
Sean Boon
SQL Server BI Product Unit

Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.

"Daune Kramer" <daune (AT) riverlooksoftware (DOT) com> wrote

Quote:
Hi Sean -

Thanks

One question - my MDX is kicking out the [Total Assets]. Since I specify
[Total Assets] in my columns, does it prevent me from using it in an
order statement on the rows?

"Sean Boon [MS]" <seanboon (AT) online (DOT) microsoft.com> wrote in
news:OkGdbBjSDHA.1868 (AT) TK2MSFTNGP11 (DOT) phx.gbl:

Hi Duane,

You need to use the ORDER() MDX function. Something like

non empty (ODER({[Primary SalesRep].[primary Sales Rep].members},
[Measure].[Total Assets], DESC)) on rows
from RPT2X

Sean






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.