立方体设计 - 带有附加列的多对多映射的桥接表
我正在 SQL Server Analysis Services 2005 中制作一个多维数据集,并且有一个关于多对多关系的问题。
我在两个实体之间存在多对多关系,其中包含一个附加描述性列作为关系的一部分。
我知道我可能需要一个桥接表来对关系进行建模,但我不确定在哪里存储附加列 - 在桥接表中还是其他地方?
Am making a cube in SQL Server Analysis Services 2005 and have a question about many to many relationships.
I have a many to many relationship between two entities that contains an additional descriptive column as part of the relationship.
I understand that I may need to a bridge table to model the relationship but I am not sure where to store the additional column - in the bridge table or elsewhere?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SSAS 中的多对多关系可以通过中间事实表来实现,该中间事实表包含受关系约束的两个维度键。
例如;如果您有一个包含图书销售事实表的多维数据集,并且您想要按作者汇总总销售额(可能有许多图书,并且一本书可能由许多作者撰写),您还应该有一个作者图书中间事实表(就像在关系数据库世界中一样)。在此桥接表中,您应该具有两个维度键(作者和书籍)以及与当前书籍和作者相关的一些度量,例如支付给作者撰写书籍(或章节)的工资。
因此,如果您的附加列是一种度量,您应该将该列添加到中间事实表中。
Many To Many relationsip in SSAS can be implemented via an intermediate fact table that contains both dimension key that subject to the relation.
For example; If you have a cube that has a book-sales-fact table and you want to aggregate total sales by author (which may have many books and a book may be written by many authors) you should also have a author-book intermediate fact table (just like in relational database world). In this bridge table, you should have both dimension keys (Author and Book) plus some measure related to the current book and author such as wages paid to the author to write the book (or chapters).
As a result, if your additional column is kind of a measure you should add that column to the intermediate fact table.