dbTalk Databases Forums  

Multi Order by

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


Discuss Multi Order by in the microsoft.public.sqlserver.olap forum.



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

Default Multi Order by - 01-09-2006 , 12:02 AM






Hi everyone,
I have this MDX query:
WITH
Set [CompanySet] as
'{[Company].[All Company].[Microsoft],[Company].[All Company].[Apple]}'
MEMBER
[Company].Selection as 'Sum([CompanySet])'
Set [DateSet] as
'{[Date].[All Date].[2005].[1].[1].[1]:[Date].[All
Date].[2005].[4].[12].[1]}'
SELECT
Non Empty [Measures].allmembers ON COLUMNS,
NonEmptyCrossJoin(
[program].[operatortype].Members,[Product].[productName].Members,[CompanySet], [DateSet], 2) on rows
FROM [ADV_SMALL]
WHERE ([Date].DateRange,[Company].Selection)

that return :
Program product Measures.....
__________________________________________________
Internet office 343255
Internet Mac 6786567
Paper windows 5435432
radio office 769876
Internet windows 7898

etc.
i wont to sort the result by program ASC and than Product ASC
How do i do that?
thanks

Reply With Quote
  #2  
Old   
Vladimir Chtepa
 
Posts: n/a

Default Re: Multi Order by - 01-09-2006 , 12:03 PM






Hi!

Do you want to get [program].members and [product].members ordered by Member
Caption?

Vladimir Chtepa



"Ruby Nadler" <RubyNadler (AT) discussions (DOT) microsoft.com> schrieb im Newsbeitrag
news:8B5863AF-1CBD-42AF-BFC9-B05665935876 (AT) microsoft (DOT) com...
Quote:
Hi everyone,
I have this MDX query:
WITH
Set [CompanySet] as
'{[Company].[All Company].[Microsoft],[Company].[All Company].[Apple]}'
MEMBER
[Company].Selection as 'Sum([CompanySet])'
Set [DateSet] as
'{[Date].[All Date].[2005].[1].[1].[1]:[Date].[All
Date].[2005].[4].[12].[1]}'
SELECT
Non Empty [Measures].allmembers ON COLUMNS,
NonEmptyCrossJoin(
[program].[operatortype].Members,[Product].[productName].Members,[CompanySet],
[DateSet], 2) on rows
FROM [ADV_SMALL]
WHERE ([Date].DateRange,[Company].Selection)

that return :
Program product Measures.....
__________________________________________________
Internet office 343255
Internet Mac 6786567
Paper windows 5435432
radio office 769876
Internet windows 7898

etc.
i wont to sort the result by program ASC and than Product ASC
How do i do that?
thanks



Reply With Quote
  #3  
Old   
Ruby Nadler
 
Posts: n/a

Default Re: Multi Order by - 01-09-2006 , 10:36 PM



Hi Vladimir,
I want to sort by
[program].[operatortype].Members BASC AND [Product].[productName].Members
BASC.
one more question about this query: in the rows i want to show the
[Product].[productName].Members level and instead the mdx returns all levels
of product dimension: Branch--> AubBranch-->ProductName. why?
thanks,
Ruby
"Vladimir Chtepa" wrote:

Quote:
Hi!

Do you want to get [program].members and [product].members ordered by Member
Caption?

Vladimir Chtepa



"Ruby Nadler" <RubyNadler (AT) discussions (DOT) microsoft.com> schrieb im Newsbeitrag
news:8B5863AF-1CBD-42AF-BFC9-B05665935876 (AT) microsoft (DOT) com...
Hi everyone,
I have this MDX query:
WITH
Set [CompanySet] as
'{[Company].[All Company].[Microsoft],[Company].[All Company].[Apple]}'
MEMBER
[Company].Selection as 'Sum([CompanySet])'
Set [DateSet] as
'{[Date].[All Date].[2005].[1].[1].[1]:[Date].[All
Date].[2005].[4].[12].[1]}'
SELECT
Non Empty [Measures].allmembers ON COLUMNS,
NonEmptyCrossJoin(
[program].[operatortype].Members,[Product].[productName].Members,[CompanySet],
[DateSet], 2) on rows
FROM [ADV_SMALL]
WHERE ([Date].DateRange,[Company].Selection)

that return :
Program product Measures.....
__________________________________________________
Internet office 343255
Internet Mac 6786567
Paper windows 5435432
radio office 769876
Internet windows 7898

etc.
i wont to sort the result by program ASC and than Product ASC
How do i do that?
thanks




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.