Intersection in MDX

試著忘記壹切 提交于 2019-12-01 09:30:49

I've had a go - you can download my solution from here:

http://sdrv.ms/YWtMod

I've added a copy of your Fact table as a "Cross Reference", Aliased the Product1 dimension as a "Cross Reference", set the Dimension references to Product independently from your existing relationships, and specified the Many-to-Many relationships.

It is returning the right answer in Excel (sample attached).

You could extend that pattern as many times as you need.

Good luck! Mike

r.m

an other way to deal with this in SQL (I know it works, but I didn't test this query) is to use double negation

select distinct orderid 
from X 
where TK NOT in (
   select TK 
   from X x_alias 
   where productid NOT in (id1,id2)
)

I'm pretty sure you can do the same in MDX.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!