dbTalk Databases Forums  

MDX Top 5 count sub level help

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


Discuss MDX Top 5 count sub level help in the microsoft.public.sqlserver.olap forum.



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

Default MDX Top 5 count sub level help - 07-16-2004 , 04:43 PM







select {[RunningTotalSubs]} on Columns, CrossJoin([Age Group].[All Age
Group].children, TopCount( { [Country].[State].members}, 5,
([RunningTotalSubs]))) on Rows from [Consumer]
How can I say I only want the top 5 States, without getting the coutries
back, or where country=US
I
tried where [Country].[Country].[US]
The cube is Country, State, City



This gets top 5 countries fine
select {[RunningTotalSubs]} on Columns, CrossJoin([Age Group].[All Age
Group].children, TopCount( { [Country].[Country].members}, 5,
([RunningTotalSubs]))) on Rows from [Consumer]



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

Default Re: MDX Top 5 count sub level help - 07-16-2004 , 05:44 PM






Not sure what results should look like - will this work?

Quote:
select {[RunningTotalSubs]} on Columns,
CrossJoin([Age Group].[All Age Group].children,
TopCount( [Country].[Country].[US].Children, 5,
([RunningTotalSubs]))) on Rows from [Consumer]
Quote:

- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Reply With Quote
  #3  
Old   
Cindy Lee
 
Posts: n/a

Default Re: MDX Top 5 count sub level help - 07-16-2004 , 06:17 PM



That woked! Thanks.
"Deepak Puri" <deepak_puri (AT) progressive (DOT) com> wrote

Quote:
Not sure what results should look like - will this work?


select {[RunningTotalSubs]} on Columns,
CrossJoin([Age Group].[All Age Group].children,
TopCount( [Country].[Country].[US].Children, 5,
([RunningTotalSubs]))) on Rows from [Consumer]



- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



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.