dbTalk Databases Forums  

Re: Question on Using Order()

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


Discuss Re: Question on Using Order() in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sean Boon [MS]
 
Posts: n/a

Default Re: Question on Using Order() - 07-15-2003 , 12:02 PM






There must be some sort of a simple syntax error in the statement. For
example, this is from the Foodmart 2000 mdx sample file and it works fine.

select
{[Measures].[Unit Sales]} on columns,
non empty order([Promotion media].members,[Measures].[Unit Sales],DESC)
on rows
from Sales

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 the following query:


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 sort by [Total Assets], so I need to use the ORDER. I made my
query look as follows:

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

But, I'm getting an error on [Total Assets] in the ORDER statement. Will
it not let me use a dimension in ORDER on Rows that I specified in
Columns?






Reply With Quote
  #2  
Old   
Francesco De Chirico
 
Posts: n/a

Default Re: Question on Using Order() - 07-16-2003 , 02:33 AM






May be the problem is that you use

[Measure].[Total Assets]

in the filter function instead of

[Measures].[Total Assets]


Francesco De Chirico



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.