Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two Conditions Where MDX Query

i'm new in MDX world and i'm having some doubt in where clausule.

I have this query

WITH
SET [~ROWS] AS
    {[Product].[All Products]}
SELECT
NON EMPTY {[Measures].[Quantity]} ON COLUMNS,
NON EMPTY [~ROWS] ON ROWS
FROM [SteelWheelsSales]
WHERE ([Time].[2003] : [Time].[2004])

And i want to add this clausule to where.

[Markets].[EMEA].[Ireland]

What i have to do? I already try this: WHERE ([Time].[2003] : [Time].[2004], [Markets].[EMEA].[Ireland])

Please, help me guys?

like image 962
Caio Granero Avatar asked Jan 28 '26 22:01

Caio Granero


1 Answers

Not sure why @whytheq's solution didn't work for you. This is similar and should work:

WITH
SET [~ROWS] AS
    {[Product].[All Products]}
SELECT
NON EMPTY {[Measures].[Quantity]} ON COLUMNS,
NON EMPTY [~ROWS] ON ROWS
FROM [SteelWheelsSales]
WHERE ({[Time].[2003] : [Time].[2004]} * {[Markets].[EMEA].[Ireland]})

Or you could go for nested sub selects:

WITH
SET [~ROWS] AS
    {[Product].[All Products]}
SELECT
NON EMPTY {[Measures].[Quantity]} ON COLUMNS,
NON EMPTY [~ROWS] ON ROWS
FROM (
       SELECT [Markets].[EMEA].[Ireland] ON 0 
       FROM (
             SELECT {[Time].[2003] : [Time].[2004]} ON 0 
             FROM [SteelWheelsSales]
            )
     )
like image 69
SouravA Avatar answered Jan 31 '26 12:01

SouravA