自助加入SSAS [英] Self-Join in SSAS

查看:105
本文介绍了自助加入SSAS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个这样的表:

PersonId    Job    City    ParentId
---------   ----   -----   --------
101          A      C1      105
102          B      C2      101
103          A      C1      102

然后,我需要获取人的工作父母的城市之间的关联规则。

Then I need to getting the association rules between Person's job and parent's city.

我使用了自引用并定义了大小写/嵌套表,但是在依赖图的结果下,人的工作或城市与父母的工作或城市之间没有区别!

I've used self-referencing and define case/nested tables but at the result of dependency graph there is no difference between person's job or city and parent's job or city!

在SSAS项目中解决此问题的最佳解决方案是什么?

What is the best solution for this problem in SSAS project?

推荐答案

<我的工作也遇到了类似的需求。到目前为止,我仅研究了
SQL Server Analysis Services表格模型。一旦完成多维模型研究,我将用更多信息更新此答案。

I've run into a similar need in my own work. So far I have only investigated SQL Server Analysis Services Tabular models. I will update this answer with more information once I have finished looking into Multidimensional models.

每个关系(SSAS表格),SSAS表格模型不支持自联接(相关内容请参见下文)引用)。您最终要做的是将父元素组及其子元素的每个级别分解为单独的模型表。拥有模型表后,就可以使用图表视图绘制相关关系。

Per Relationships (SSAS Tabular), SSAS Tabular models do not support self-joins (see below for the relevant quote). What you end up having to do is break out the group of parent elements and each level of their child elements as separate model tables. Once you have the model tables, you can use the diagram view to draw the relevant relationships.


自连接和循环

在表格模型表中不允许进行自我联接。自联接是表与其自身之间的
递归关系。自连接是
,通常用于定义父子层次结构。例如,您可以
将一个Employees表与其自身连接以产生一个层次结构,该层次结构显示
一家企业的管理链。

Self-joins are not permitted in tabular model tables. A self-join is a recursive relationship between a table and itself. Self-joins are often used to define parent-child hierarchies. For example, you could join an Employees table to itself to produce a hierarchy that shows the management chain at a business.

模型设计者不允许在模型的
关系中创建循环。换句话说,下面的
关系集被禁止。 +

The model designer does not allow loops to be created among relationships in a model. In other words, the following set of relationships is prohibited. +

表1,列a至表2,列f

Table 1, column a to Table 2, column f

表2,列f至表3 ,列n

Table 2, column f to Table 3, column n

表3,列n至表1,列a

Table 3, column n to Table 1, column a

如果您尝试创建一个关系,将导致创建
的循环,并生成错误。

If you try to create a relationship that would result in a loop being created, an error is generated.

这篇关于自助加入SSAS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆