Hi, I just recently found we have duplicated records in our fact tables which are allowable. That means the combination of all dimension keys cannot uniquely determine a row in the fact table. Consider the following data:Fact TestDateKey TestKey CustomerKey Amount5 1 1 165 1 2 105 1 2 4When I tried to get the average Amount by DateKey and TestKey, I used the following mdx queryWITH MEMBER Measures.AvgAmountCal AS ( avg({[Dim Test].[Test Key].CURRENTMEMBER*[Dim Customer].[Customer Key].CHILDREN*[Dim Date].[Date Key].CURRENTMEMBER}, Measures.[Amount] ))SELECT {Measures.[Amount],[Measures].[Fact Test Count],Measures.AvgAmountCal} ON 0 ,NONEMPTYCROSSJOIN([Dim Date].[Date Key].&[5], [Dim Test].[Test Key].CHILDREN) ON 1FROM [Test DB]However the result is Amount Fact Test Count AvgAmountCal5 1 30 3 15It is more like that SSAS aggregate the duplicate key rows into one and count them as one row. Of course this can be solved by using Amount/[Fact Test Count]. But how can I calculate Standard Deviation/Top Percentile? They gave me the wrong value. I have tried serveral ways, including changing SSAS cube aggregation method from Sum to None. But it still does not solve the problem. This is very urgent. Anyone please provide your inputs. Thanks ahead!
↧