SSAS表格项目中的多对多关系 [英] Many-to-many relationship in SSAS Tabular project
问题描述
我正在尝试在SSAS表格中建立多对多关系.
I'm trying to set up a many-to-many relationship in SSAS Tabular.
我的表格项目中有以下内容(销售,客户,客户电子邮件):
I've got the following in my tabular project (sales, customers, customer emails):
销售与客户相关.一个客户可以有多封电子邮件.
A sale is tied to a customer. A customer can have multiple emails.
如何创建适合数据透视表当前过滤器的所有电子邮件的列表?
How would I create a list of all emails that fit the current filter of a pivot table?
例如,我可以创建一个数据透视表,显示保证金< 20%的帐户",并想要一个与这些帐户相关联的所有电子邮件的列表.
For example, I could create a pivot table shows "accounts with margin < 20%", and want a list of all emails associated with those accounts.
样品,从以下销售数据开始:
Sample, starting with the following sales data:
customer # | revenue
1234 | 100
6789 | 50
我希望看到类似的内容(取决于确切的数据透视表设置)
I would expect to see something like (depending on the exact pivot table settings)
1234
one@sample.com | 100
two@sample.com | 100
6789
three@sample.com | 50
( one@sample.com
和 two@sample.com
都绑定到同一帐户)
(one@sample.com
and two@sample.com
are both tied to the same account)
相反,我得到了:
1234
one@sample.com | 100
two@sample.com | 100
three@sample.com | 100
5678
one@sample.com | 50
two@sample.com | 50
three@sample.com | 50
推荐答案
SQL Server 2012和2014不支持多对多"关系.SQLServer 2016将包含此缺少的功能.解决此问题的简单方法是将所有相关表放在过滤器中.此快捷方式在我的环境中有效.下面给出示例供您参考.Measure1:= calculate(sum [sales],'Customer','Emails')
Many-to-may relationship is not supported in SQL Server 2012 and 2014. SQL Server 2016 will contain this missing feature. The simple work around to solve this issue is to place all related tables in filter. This shortcut worked in my environment. Example is given below for your reference. Measure1:=calculate(sum[sales],'Customer','Emails')
尝试后让我知道.
这篇关于SSAS表格项目中的多对多关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!