SSAS One to Many Dimensional Relationship

后端 未结 2 1948
名媛妹妹
名媛妹妹 2021-01-18 19:32

Question in SSAS for y\'all. I am attempting to define a One to Many relationship in an OLAP SSAS cube environment. However, i\'m running into problems with defining a pri

相关标签:
2条回答
  • 2021-01-18 19:45

    you need to do 2 dimensions here.

    first, you should not add your date as part of the whole dimension. The date itself should exist as a dimension.

    second, as I see, you should join NYMEX Contract and Model Contract and make a dimension. You can join them on the DSV with a named query or make a SQL view or you can have both tables separated on the DSV and join them on the dimension.

    Third, NYMEX Trades is your fact table. Once you have both previous dimensions created, you should add them to the cube and join them with the fact table on the dimension relationship tab using the fields ContractName and TradeDate

    0 讨论(0)
  • 2021-01-18 20:04

    What you have is an example of a many-to-many relationship between you fact data (Trades) and your dimension data (Model Contract). have a look at this: dimension relationship . Your case is a rare case since model contracts can only be assigned to one Contract Name but it still falls under the many-to-many case. This is handled using a bridge-table in dimensional modeling and in SSAS they call it an intermidiate fact table. Once you have your DSV setup like this: enter image description here

    You would then create your dimensions in your project and then create a measure group for ModelContract to be able to use it as an intermediate fact table. You would then setup the dimension usage for the cube choosing a many-to-many relationship:

    enter image description here enter image description here

    As a side note, you should always use surrogate keys for your dimensions. They have several advantages such as storage space in you fact table, slowly changing dimensions, source system decoupling,...

    0 讨论(0)
提交回复
热议问题