dbTalk Databases Forums  

MDX Where Clause

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


Discuss MDX Where Clause in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andrea Worley
 
Posts: n/a

Default MDX Where Clause - 01-09-2004 , 09:51 AM






I posted this yesterday but I don't see it. I want to limit the data similar to a SQL WHERE statement. I can limit it with a FILTER statement when I show the fields on the row axis, but I don't want to show the field, I just want to use it as criteria. So if I want to limit my results to only certain education levels, but I don't need to see the education levels, I want something similar to the MDX below. I know the where clause is wrong, but can somebody help me translate that to MDX? Thanks

SELECT {[measures].[Unit Sales]} On Columns, {[Customer].[Name].members} on rows FROM SALE
WHER
[Education Level].[Bachelor's Degree] OR [Education Level].[Graduate Degree] OR [Education Level].[High School Degree]

Reply With Quote
  #2  
Old   
Matthias Englert
 
Posts: n/a

Default Re: MDX Where Clause - 01-09-2004 , 10:36 AM






Hi,

you can use a calc member to create a:

with member
[Education Level].[My Levels] as
'sum({[Education Level].[Bachelors Degree] , [Education Level].[Graduate
Degree], [Education Level].[High School Degree]})'

SELECT {[measures].[Unit Sales]} On Columns, {[Customers].[city].members} on
rows FROM SALES
WHERE
([Education Level].[My Levels])


Regards,
Matthias

"Andrea Worley" <k_rage (AT) hotmail (DOT) com> schrieb im Newsbeitrag
news:E3EB3C24-CC49-41B9-8CF4-E70DDB43171A (AT) microsoft (DOT) com...
Quote:
I posted this yesterday but I don't see it. I want to limit the data
similar to a SQL WHERE statement. I can limit it with a FILTER statement
when I show the fields on the row axis, but I don't want to show the field,
I just want to use it as criteria. So if I want to limit my results to only
certain education levels, but I don't need to see the education levels, I
want something similar to the MDX below. I know the where clause is wrong,
but can somebody help me translate that to MDX? Thanks.
Quote:
SELECT {[measures].[Unit Sales]} On Columns, {[Customer].[Name].members}
on rows FROM SALES
WHERE
[Education Level].[Bachelor's Degree] OR [Education Level].[Graduate
Degree] OR [Education Level].[High School Degree]




Reply With Quote
  #3  
Old   
Andrea Worley
 
Posts: n/a

Default Re: MDX Where Clause - 01-09-2004 , 02:16 PM



Thank you, Matthias. That works perfect. I was trying to do a calculated member with a filter and that didn't work at all


----- Matthias Englert wrote: ----

Hi

you can use a calc member to create a

with membe
[Education Level].[My Levels] a
'sum({[Education Level].[Bachelors Degree] , [Education Level].[Graduat
Degree], [Education Level].[High School Degree]})

SELECT {[measures].[Unit Sales]} On Columns, {[Customers].[city].members} o
rows FROM SALE
WHER
([Education Level].[My Levels]


Regards
Matthia

"Andrea Worley" <k_rage (AT) hotmail (DOT) com> schrieb im Newsbeitra
news:E3EB3C24-CC49-41B9-8CF4-E70DDB43171A (AT) microsoft (DOT) com..
Quote:
I posted this yesterday but I don't see it. I want to limit the dat
similar to a SQL WHERE statement. I can limit it with a FILTER statemen
when I show the fields on the row axis, but I don't want to show the field
I just want to use it as criteria. So if I want to limit my results to onl
certain education levels, but I don't need to see the education levels,
want something similar to the MDX below. I know the where clause is wrong
but can somebody help me translate that to MDX? Thanks
Quote:
SELECT {[measures].[Unit Sales]} On Columns, {[Customer].[Name].members
on rows FROM SALE
WHER
[Education Level].[Bachelor's Degree] OR [Education Level].[Graduat
Degree] OR [Education Level].[High School Degree





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.