cancel
Showing results for 
Search instead for 
Did you mean: 

MDX Where clause specification

Former Member
0 Kudos

Hello All,

I've a problem with WHERE clause in MDX...

my requirement is to select members from data source using several filters with WHERE clause.

e.g.

Select {Dimension1.member1, Dimension2.member1} on ROWS, {Measures.Measure1} on COLUMNS from DATASOURCE

WHERE (Dimension3.memberX, Dimension3.memberY, Dimension4.memberA ....DimensionN.memberN)

unfortunately this query in ignoring the filter settings, but if I user SINGLE dimension then it's working!!!

Could anybody know the problem behind this?

Thanks and regards

Swamy

Accepted Solutions (1)

Accepted Solutions (1)

JohnL
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Swamy,

Your syntax looks correct. Have you tried using square brackets around your dimension ID'sand dimension member ID's ?

i.e.

SELECT FROM SalesCube

WHERE ([Time].[2004], [Geography].[Quebec],[Product].[Snorkels], [Channel].[Superstores])

Thanks,

John

Former Member
0 Kudos

Hi John,

Thanks for quick reply... I tried with square brackets too..

likeI said, its working when I use only ONE member from EACH dimension

(Time.2004, Geography.Quebec,Product.Snorkels, Channel.Superstores)

But my requirement is to use MULTIPLE members from MULTIPLE dimensions

e.g. (Time.2004, Time.2005, Time.2006, Geography.Quebec, Geography.BERLIN,Product.Snorkels, Channel.Superstores)

is there anything wrong???

thanks once again

Swamy

Former Member
0 Kudos

Hi All,

Thanks for your replies..

I found a solution where we can user MULTIPLE dimensions with respective MULTIPLE members WITH IN {} braces in WHERE clause..

we've to use CROSS JOIN

e.g.

select{...} on rows, {...} columns from... WHERE {{Dim_1.mem_11, Dim_1.mem_12}*{Dim_2.mem_21, Dim_2.mem_22}}

Answers (0)