SQL Analysis Services - 具有“多”属性的维度属性 基数

发布于 2024-07-14 09:45:06 字数 383 浏览 6 评论 0原文

我正在创建一个包含以下表格的多维数据集:

客户 客户ID, 姓名

客户代表 客户ID, RepID

代表 重复 ID, 名称

这里重要的是代表和客户之间存在多对多的关系。 我希望能够提出这样的问题:“与代表‘A’合作的客户的销售额是多少?” 在数据源视图中,我设置了 customerid 列和 repid 列之间的关系。 我在维度构建器中设置了代表属性,当我尝试构建多维数据集时,我收到此错误:

高级关系引擎中出现错误。 无法根据数据源视图中的关系访问联接所需的“Rep”表。

I am creating a cube with the following tables:

Customer
CustomerID,
Name

Customer Rep
CustomerID,
RepID

Rep
RepID,
Name

The important thing here is that there is a many to many relationship between Reps and Customers. I want to be able to ask the question "How much sales for customers working with rep 'A'?" In the data source view i set up the relationships between both customerid columns and both repid columns. I set up the rep attribute in the dimension builder and when I try to build the cube I get this error:

Errors in the high-level relationship engine. the 'Rep' table that is required for a join cannot be reached based on the relationships in the data source view.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

無心 2024-07-21 09:45:06

您没有显示销售如何与客户/销售代表相关,但我猜您在销售事实表中有一个 CustomerID。

您需要将客户和代表设置为 2 个独立的维度。 客户维度将直接连接到销售事实。

要加入“代表”维度,您需要从“客户代表”表创建一个度量值组,然后使用“客户代表”度量值组在代表和销售事实之间创建多对多关系。

关于多对多关系有一个非常好的白皮书 这里

You don't show how sales is related to Customers/Reps, but I would guess that you have a CustomerID in the Sales fact table.

You need to setup Customer and Rep as 2 separate dimensions. The Customer Dimension would be joined directly to the Sales Fact.

To join the Rep dimension you would need to create an measure group from the "Customer Rep" table and then create a many-to-many relationship between Rep and Sales Fact, using the "Customer Rep" measure group.

There is a really good white paper on many-to-many relationships here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文