I'm quite new to data warehousing and MDX queries, and I realize that I'm probably not using the MDX syntax properly in the case below.
I'm using SSAS 2005 on MS SQL Server 2005 and would like to query my cube and filter the results with multiple members from the same hierarchy (the filtered members are "sibling"), given a specific year ([2013]) and markets breakdown on rows.
WITH
MEMBER [Measures].[Value] AS Format([Measures].[Expected Sale Price EUR], '#,###')
MEMBER [Measures].[Pieces] AS Format([Measures].[Line Quantity], '#,###')
SELECT
CrossJoin(
{[Time].[Calendar Year].&[2013]},
{[Measures].[Value],[Measures].[Measures].[Pieces]})
ON COLUMNS,
{[Customers].[Markets].Members}
DIMENSION PROPERTIES MEMBER_NAME ON ROWS
FROM [Po System]
WHERE ({[Order Type].[Order Type].&[1],
[Order Type].[Order Type].&[5],
[Order Type].[Order Type].&[6]},
{[Customers].[Customers].&[1012],
[Customers].[Customers].&[1922]})
The result I get is an aggregation of the measurables for the whole market to which those customers belong.
The thing is that if I use only member of the [Customers] dimensions inside the WHERE clause, and only if I don't wrap it with { } brackets, I get the results I want - aggregation of the data for customer [1012] only, as it should be (verified with my original data source).
Here's an example for a WHERE clause in the same query that gives me the correct results for one customer filtering:
WHERE ({[Order Type].[Order Type].&[1],
[Order Type].[Order Type].&[5],
[Order Type].[Order Type].&[6]},
[Customers].[Customers].&[1012])
In the query with this WHERE clause I get the proper results, but just for one member.
I constantly verify the integrity of the data in my cube by using the Cube Browser within the BI Development Studio (v. 2005).
I've also looked into the SQL Server Profiler to get the queries generated by the Cube Browser, but those are unreadable and non-executable from the Management Studio, where are run my MDX queries for tests.
Any idea on what's wrong with the syntax I use?