Groups | Blog | Home
all groups > sql server data warehouse > september 2003 >

sql server data warehouse : How can I order the result of a query to a cube


Paulo Andre Ortega Ribeiro
9/2/2003 1:04:59 PM
I would like to order the result of a MDX command to a cube by one of
the measures. Is it possible?
When I´m creating a dimension I can specify that I want to order a
dimension by name, key or a property.

But my boss would like to see the the customer who sold more in the last
month. So It´d be better if the result returned ordered by the measure,
not by the customer´s name.
Can I do that? Is there a ORDER By clause in the MDX?

Thanks,

Paulo



*** Sent via Developersdex http://www.developersdex.com ***
Yashwant
9/3/2003 3:49:01 PM
use Order function or MDX to do that.

here is a sample

select=20
{[Measures].[Unit Sales]} on columns,=20
order(except([Promotion Media].[Media Type].members,
{[Promotion Media].[Media Type].[No Media]}),[Measures].
[Unit Sales],DESC) on rows
from Sales


cheers
yashwant


[quoted text, click to view]
AddThis Social Bookmark Button