MDX:如果您有连接维度键的桥 table,则从两个事实 table 加入度量
MDX: join measures from two fact tables if you have bridge table that connects dimension keys
我有两个事实 tables:
fact_A:
DimensionOneKey Amount1
---------------------------
1 10
2 11
fact_B:
DimensionTwoKey Amount2
---------------------------------
1 5
2 6
我有桥 table,其中包含 DimensionTwoKey 和 DimensionOnekey 之间的多对多关系
桥表:
DimensionOneKey DimensionTwoKey
------------------------------------
1 2
2 2
目前在立方体中我有 Measure Amount1 和 Measure Amount2,但我没有桥 table 提供给我的这两个量之间的联系。
我想到的一个解决方案是使用其中一个事实加入 Bridge table 并添加缺失的度量,例如将 Amount2 添加到 fact_A。但那样我会在多维数据集中复制 Amount2。
是否可以借助桥 table 以某种方式将立方体中的这两个度量关联起来,只是通过在两个度量之间添加某种关系,而不是上面的方式,所以最终结果将有可能创建下一份报告:
结果:
DimensionOneKey DimensionTwoKey Amount1 Amount2
------------------------------------------------
1 2 10 6
2 2 11 5
Is it possible to somehow associate these two measures in the cube
with the help of bridge table, just by adding some kind of
relationship between two measures, and not with the way above, so the
end result would make possible to create next report:
Yes you can do this. You need to take a look at Many-to-Many relationship in DimensionUsage tab of your SSAS project. The Idea is that your DimensionOne will join to a BridgeTable just as you have decribed. This bridge table then joins to DimensionTwo.
我有两个事实 tables:
fact_A:
DimensionOneKey Amount1
---------------------------
1 10
2 11
fact_B:
DimensionTwoKey Amount2
---------------------------------
1 5
2 6
我有桥 table,其中包含 DimensionTwoKey 和 DimensionOnekey 之间的多对多关系
桥表:
DimensionOneKey DimensionTwoKey
------------------------------------
1 2
2 2
目前在立方体中我有 Measure Amount1 和 Measure Amount2,但我没有桥 table 提供给我的这两个量之间的联系。
我想到的一个解决方案是使用其中一个事实加入 Bridge table 并添加缺失的度量,例如将 Amount2 添加到 fact_A。但那样我会在多维数据集中复制 Amount2。
是否可以借助桥 table 以某种方式将立方体中的这两个度量关联起来,只是通过在两个度量之间添加某种关系,而不是上面的方式,所以最终结果将有可能创建下一份报告:
结果:
DimensionOneKey DimensionTwoKey Amount1 Amount2
------------------------------------------------
1 2 10 6
2 2 11 5
Is it possible to somehow associate these two measures in the cube with the help of bridge table, just by adding some kind of relationship between two measures, and not with the way above, so the end result would make possible to create next report: Yes you can do this. You need to take a look at Many-to-Many relationship in DimensionUsage tab of your SSAS project. The Idea is that your DimensionOne will join to a BridgeTable just as you have decribed. This bridge table then joins to DimensionTwo.