不平衡的层次结构引用相同的属性

时间:2014-08-22 11:19:27

标签: ssas mdx hierarchy olap-cube

我计划在现有多维数据集中基于生产数据库创建维Location。问题是这个数据库包含一个带有自引用对象的层次结构,一个名为locations:

的表
+----+----------+------------+
| id | parentId | name       |
+----+----------+------------+
| 1  | NULL     | Building A |
+----+----------+------------+
| 2  | 1        | Floor 1    |
+----+----------+------------+
| 3  | 2        | Room 11    |
+----+----------+------------+
| 4  | 2        | Room 12    |
+----+----------+------------+
| 5  | 2        | Room 13    |
+----+----------+------------+
| 6  | 1        | Floor 2    |
+----+----------+------------+
| 7  | 6        | Room 21    |
+----+----------+------------+
| 8  | 6        | Room 22    |
+----+----------+------------+
| 9  | NULL     | Building B |
+----+----------+------------+
| 10 | 9        | Room 1     |
+----+----------+------------+
| 11 | 9        | Room 2     |
+----+----------+------------+
| 12 | 9        | Room 3     |
+----+----------+------------+
| 13 | NULL     | Storage    |
+----+----------+------------+
| 14 | NULL     | Reception  |
+----+----------+------------+

enter image description here

通常我会创建一个类似日期的层次结构,属性月份是属性日期的父级,属性年份是属性月份的父级。但是,在这种情况下,维度Name中的属性Location可能是另一个Name的父级。

如何从这些记录中创建层次结构?

1 个答案:

答案 0 :(得分:2)

这是父子层次结构的含义。请参阅documentation