我是 SSAS 新手,遇到了一个无法解决的问题。让我们从两个表开始,这个表是一个包含帐户及其值的事实表:
Fact Table
==============
Account Value
==============
1 10
2 20
3 30
然后是提供维度的帐户层次结构表。此维度包含帐户层次结构。帐户被分组到组中,一个给定的帐户可以根据需要多次放置在几个不同的组中。不可能在同一组内拥有两次或多次相同帐户的情况。出于性能原因,层次结构是自然化的(这是正确的术语吗?),使用HideMemberIf
属性。群体本身没有价值,他们从孩子的集合中获取价值。真正的层次结构有 16 个级别,但为简单起见,这里是一个只有 4 个级别的示例:
Dim Groups-Accounts
========================================
Level 0 Level 1 Level 2 Level 3
========================================
Group 0 Group 0 Group 0 Group 0
Group 0 Group 1 Group 1 Group 1 (empty group)
Group 0 Group 2 Group 2 Group 2
Group 0 Group 2 Account 1 Account 1
Group 0 Group 3 Group 3 Group 3
Group 0 Group 3 Account 2 Account 2
Group 0 Group 3 Account 3 Account 3
Group 0 Group 4 Group 4 Group 4
Group 0 Group 4 Group 5 Group 5
Group 0 Group 4 Group 5 Account 2
Group 0 Group 4 Group 5 Account 3
Group 6 Group 6 Group 6 Group 6 (empty group)
导航维度时,这将导致如下结果:
======================================
Level 0 Level 1 Level 2 Level 3
======================================
Group 0
Group 1
Group 2
Account 1
Group 3
Account 2
Account 3
Group 4
Group 5
Account 2
Account 3
Group 6
目标是将归化层次结构的最后一级(在本例中为 3 级)与事实表中的适当值相关联:
=================================================
Level 0 Level 1 Level 2 Level 3 Value
=================================================
Group 0 110
Group 1 0
Group 2 10
Account 1 10
Group 3 50
Account 2 20
Account 3 30
Group 4 50
Group 5 50
Account 2 20
Account 3 30
Group 6 0
问题?在处理维度时,SSAS 抱怨Errors in the OLAP storage engine: A duplicate attribute key has been found when processing: Table: 'CT_DimGroupsAccounts', Column: 'Level_3', Value: 'Account 2'. The attribute is 'Level_3'.
. 这是真的,因为帐户 2 和帐户 3 在级别 3 属性中是重复的。如果我告诉 SSAS 忽略重复键错误,则处理成功结束。但是,在导航生成的多维数据集时,结果是:
=================================================
Level 0 Level 1 Level 2 Level 3 Value
=================================================
Group 0 60
Group 1 0
Group 2 10
Account 1 10
Group 3 50
Account 2 20
Account 3 30
Group 4 0
Group 5 0
Group 6 0
重复的键(作为第 5 组子项的帐户 2 和 3)不在维度中,结果不正确。在这种情况下,我怎样才能获得正确的结果?