dbTalk Databases Forums  

MDX please help

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


Discuss MDX please help in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
karenmiddleol@yahoo.com
 
Posts: n/a

Default MDX please help - 05-14-2005 , 03:46 AM






against the FoodMart Sales cube I have the following query:

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



I want to now exclude sales Where Store Type <> "Head Quarters" and
StoreType <> "Supermarket"
and also I want to exclude the following in the sales reported
Education Level <> "Partial College" and Education Level <> "Partial
High School"

I do not have StoreType or Education Level in either the Rows or the
columns Axis I just want to exclude the above please note I am using
this as an example in another scenario I have sales for 200 customers
and I want to exclude the sales for only 4 customers and customers is
in neither of the axis.

Please help.

Thanks
Karen


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

Default Re: MDX please help - 05-16-2005 , 10:39 AM






OLAP client tool like Excel typically create aggregated members in the
Where slicer for select lists, like:

Quote:
With Member [Education Level].[All Education Level].[SelectedEdLevels]
as
'Aggregate(Except([Education Level].[Education Level].Members,
{[Education Level].[All Education Level].[Partial College],
[Education Level].[All Education Level].[Partial High School]}))'
Member [Store Type].[All Store Type].[SelectedStoreTypes] as
'Aggregate(Except([Store Type].[Store Type].Members,
{[Store Type].[All Store Type].[HeadQuarters],
[Store Type].[All Store Type].[Supermarket]}))'

select
{[Measures].[Unit Sales]} on columns,
order(except([Promotion Media].[Media Type].members,
{[Promotion Media].[Media Type].[No Media]}),[Measures].[Unit
Sales],DESC) on rows
from Sales
where ([SelectedEdLevels], [SelectedStoreTypes])
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


Reply With Quote
  #3  
Old   
karenmiddleol@yahoo.com
 
Posts: n/a

Default Re: MDX please help - 05-16-2005 , 12:22 PM



Hi Deepak

Many thanks for your help

Thanks
Karen


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.