dbTalk Databases Forums  

MDX multiple where clause

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


Discuss MDX multiple where clause in the microsoft.public.sqlserver.olap forum.



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

Default MDX multiple where clause - 01-13-2004 , 09:01 AM






I am trying to put two different restrictions in the where clause from two different dimensions. The Microsoft documentation shows examples of this, but I'm getting the error: Cannot convert set to tuple in the {...} function. Can somebody help? Using foodmart, I want to show the top 3 customers that are college educated and not married. My attempt is below. If I leave out the College Educated or Marital Status part of the WHERE clause, it will work

WITH member [Education Level].[College Educated] as 'sum({[Education Level].[Bachelors Degree], [Education Level].[Graduate Degree]})'
SELECT {[Measures].[Unit Sales]
on columns, TOPCOUNT({[Customers].[Name].members},3,[Measures].[Unit Sales]
on rows FROM Sales WHERE {[Marital Status].[S],[Education Level].[College Educated]}

Reply With Quote
  #2  
Old   
Alexander Stojakovic
 
Posts: n/a

Default Re: MDX multiple where clause - 01-13-2004 , 10:08 AM






WITH member
[Education Level].[College Educated] as 'sum({[Education
Level].[Bachelors Degree], [Education Level].[Graduate Degree]})'

SELECT {[Measures].[Unit Sales]} on columns,
TOPCOUNT({[Customers].[Name].members},3,[Measures].[Unit
Sales]) on rows
FROM Sales WHERE ([Marital Status].[S], [Education Level].[College
Educated])

good luck

Sascha

"Andrea Worley" <k_rage (AT) hotmail (DOT) com> schrieb im Newsbeitrag
news:77BDC0C8-184E-47B6-9E2C-9B32D156DE32 (AT) microsoft (DOT) com...
Quote:
I am trying to put two different restrictions in the where clause from two
different dimensions. The Microsoft documentation shows examples of this,
but I'm getting the error: Cannot convert set to tuple in the {...}
function. Can somebody help? Using foodmart, I want to show the top 3
customers that are college educated and not married. My attempt is below.
If I leave out the College Educated or Marital Status part of the WHERE
clause, it will work.
Quote:
WITH member [Education Level].[College Educated] as 'sum({[Education
Level].[Bachelors Degree], [Education Level].[Graduate Degree]})'
SELECT {[Measures].[Unit Sales]}
on columns, TOPCOUNT({[Customers].[Name].members},3,[Measures].[Unit
Sales])
on rows FROM Sales WHERE {[Marital Status].[S],[Education Level].[College
Educated]}




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

Default Re: MDX multiple where clause - 01-13-2004 , 10:36 AM



I thought I tried every combination of {} and (). Thanks so much. I'm still learning the difference of all the subtle (to me) notations.

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.