You can use AGGREGATE function to join the set as member. for example see the below given expression:
WITH
SET [TwoMonth] AS
{
[Order Date].[Date By Year].[Month].&[200303],
[Order Date].[Date By Year].[Month].&[200304]
}
MEMBER [Measures].[TowMonth] AS
AGGREGATE({
[Order Date].[Date By Year].[Month].&[200303],
[Order Date].[Date By Year].[Month].&[200304]
})
Now if you are using the Member expression you will get the aggregated value of two months of Order Quantity measures.
SELECT ([Order Date].[Date By Year].[TwoMonth],[Measures].[Order Quantity]) ON 0 FROM Sales
//// Output (using AWDW database) TwoMonth 9260
Verify the result, use the set [TwoMonth], you should get the same result.
SELECT ([TwoMonth],[Measures].[Order Quantity]) ON 0 FROM Sales
// Output: March 3860, April 5400
WITH
SET [TwoMonth] AS
{
[Order Date].[Date By Year].[Month].&[200303],
[Order Date].[Date By Year].[Month].&[200304]
}
MEMBER [Measures].[TowMonth] AS
AGGREGATE({
[Order Date].[Date By Year].[Month].&[200303],
[Order Date].[Date By Year].[Month].&[200304]
})
Now if you are using the Member expression you will get the aggregated value of two months of Order Quantity measures.
SELECT ([Order Date].[Date By Year].[TwoMonth],[Measures].[Order Quantity]) ON 0 FROM Sales
//// Output (using AWDW database) TwoMonth 9260
Verify the result, use the set [TwoMonth], you should get the same result.
SELECT ([TwoMonth],[Measures].[Order Quantity]) ON 0 FROM Sales
// Output: March 3860, April 5400
Comments