Lower Date Granularity for FactBudget

…衆ロ難τιáo~ 提交于 2019-12-11 12:02:49

问题


I'm currently struggling with the following problem:

In our fact table Budget we define a monthly budget. Each entry has therefore a date key 'YYYYMM'. This is however a lower granularity compared to our dimension Date where we have entries per day (-> date key is 'YYYYMMDD').

Therefor I created the dimension PeriodMonth, where we have the primary key as 'YYYYMM' and separate fields for the month, month name and the year. To link the table to our main time dimension, I added a foreign key field PeriodMonthKey to the dimension Date, which points to the PeriodMonth dimension table.

Now I would like to be able to filter the fact Budget with the year/month fields from the main time dimension Date. In the 'Dimension Usage' tab in the cube design view I tried to set up a referenced relationship between the fact (Budget) and the two dimension (Date, PeriodMonth) tables. Unfortunately I was only able to define one attribute for the relationship between the reference and the intermediate dimension.

Here two screenshots of what it looks like:

For testing purposes I just added budget values for each month of the year 2014. When I filter the budget values by DimDate.Month it correctly displays the budget values per month for 2014. When I filter by DimDate.Year instead of the single entry for 2014, the following is shown: (right part)

I see why it's not working with DimDate.Year but don't know how to solve it. Am I on the wrong track altogether or am I just missing something small? Any input is highly appreciated.

Best regards Sebastian


回答1:


I would assume you are missing the relationship from month to year in the DimDate hierarchy. Analysis Services aggregates from the attribute referenced from the fact table to all attributes that have relationships in the dimension. To set up these relationships, open the dimension in BIDS, and configure it on the "Attribute relationships" tab.

You possibly could even get rid completely of the dimension "Dim Period Month", and just use a regular relationship from "Fact Budget" to the Month level of "Dim Date". This cannot be configured in the Data Source View, but on the "Dimension Usage" tab of the cube editor. This might or might not confuse your users more than having different dimensions to select from.



来源:https://stackoverflow.com/questions/26628515/lower-date-granularity-for-factbudget

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