I think the following might be what you are after. I have based the
query on the Foodmart 2000 sample database and I have assumed that your
Set1 and Set2 are based on members from a single dimension.
Unfortunately the intersection logic requires some knowledge of which
dimension the two sets are based on.
SET Set1 as '{[Product].[All Products].[Drink].[Alcoholic Beverages].
[Beer and Wine].children,[Product].[All Products].[Drink].[Dairy].
[Dairy].children}'
SET Set2 as '{[Product].[All Products].[Drink].[Dairy].
[Dairy].children,[Product].[All Products].[Food].[Baking Goods].[Baking
Goods].children}'
MEMBER Measures.Intersects as 'IIF(INTERSECT(Set1,INTERSECT(Set2,
{Product.CurrentMember})).count =1,1,0)'
Select
{measures.[Store Sales],measures.Intersects} ON 0,
UNION(set1,set2) ON 1
FROM Sales
--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell
In article <06D80409-9555-4667-9A9D-CD62AE2B6F4C (AT) microsoft (DOT) com>,
Peter (AT) discussions (DOT) microsoft.com says...
Quote:
Hi
I have to create a query that unions 2 sets and then indicate which members
from set1 was also in set2.
Is there a way to do the following.
SELECT ([Measure].[Sales]) ON 0
( ([SET1] UNIONED [SET2])
,IIF(INTERSECT([SET1], SET2)=TRUE , 0, 1)) ON 1
FROM Cube
Thanks
Peter |