MDX : Taking a union of slices -
09-10-2004
, 07:44 AM
In a MDX query, I would like to slice on 2 dimensions in the following
way:
The sales cube in the sample OLAP database I need to retrieve the Unit
Sales for Gender=Male or Marital Status=Married.
To obtain the results without the above slice, I query the cube as
WITH
SET __CRYSTAL_SET_ON_AXIS_0__ AS ' { [Measures].[Unit Sales]
} '
SET __CRYSTAL_SET_ON_AXIS_1__ AS ' { [Store].[Store
Country].AllMembers } '
SELECT
__CRYSTAL_SET_ON_AXIS_0__ ON COLUMNS ,
__CRYSTAL_SET_ON_AXIS_1__ ON ROWS
FROM [Sales]
If I add
WHERE
( [Gender].[Gender].&[M], [Marital Status].[Marital Status].&[M]
)
the results are an intersection of the set with Gender=M and Marital
Status=M. I am interested in the union.
Can someone suggest a way to query for a union in the where clause?
The actual number of dimensions in the cube I am working on is around
8, and hence would be having to solve the above problem for a union of
members from around 8 dimensions.
Thanks
Yash |