SSAS->多维数据集浏览/查询 ->维度与另一个维度具有三个关系,检索数据时出现问题
我有一个事实 [订单] 和一个客户维度 [客户]。这两者之间存在三种关系,因为事实上订单可以拥有三种类型的客户。 :托运人、收货人、提单人。因此,反过来,当我尝试通过客户维度中的客户 ID 和名称浏览数据并尝试提取事实顺序属性时,多维数据集无法确定应根据三个属性中的哪一个来拼接数据。
我本质上只是想找出处理这种情况的最佳方法。显然,我可以规范化该表并创建三个特定于我上面指定的类型的分配表,这将缓解该问题。我只是想知道是否有一种方法可以在多维数据集中执行此操作而不更改 sql 数据库中表的结构。
I have a fact [Orders], and a customer dimension [Customers]. There are three relationships between these two, as the fact Orders can have three types of customers. : shipper, consignee, billto. So, in turn when I try to browse the data via the customer id and name from the customer dimension and try to pull in fact order attributes the cube is unable to determine which of the three attributes it should splice data by.
I am essentially just attempting to figure out the best way to handle the situation. Obviously, I could normalize the table and create three assignment tables specific to the types that I specify above which would alleviate the issue. I am just wondering if there is a way to do this in the cube without changing the structure of the tables in the sql database.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有几种方法可以处理 DimCustomer 和 FactOrders 之间的关系,因此这取决于您如何建模数据...
如果 FactOrders 有 3 个字段,每个字段都链接回 DimCustomer,如下所示...
...那么您最终会得到SSAS 数据库中的客户有 3 个维度。您可以通过角色扮演(1 个维度向多维数据集添加 3 次)或作为 3 个单独的维度来实现这些维度。后者允许更用户友好的命名约定。
另一方面,如果您的 FactOrders 表只有 1 个链接到 DimCustomer 的字段,如下所示...
...那么您将需要使用两种方法之一来区分“客户类型”(发货人、收货人、收货人)...
方法 1:在 DimCustomer 表中创建 CustomerType 字段,并将其设为 SSAS 项目中客户维度的属性...
方法 2:创建新的维度表(DimCustomerType) 并将其添加到您的多维数据集...
There are a few ways to handle the relationship between DimCustomer and FactOrders so it depends on how you have the data modeled...
If FactOrders has 3 fields that each link back to DimCustomer like below...
...then you will end up with 3 dimensions for Customers in your SSAS database. You can implement these dimensions via Role-Playing (1 dimension added 3 times to your cube) or as 3 separate dimensions. The latter allows for more user-friendly naming conventions.
On the other hand, if your FactOrders table only has 1 field that links to DimCustomer like below...
...then you will need to differentiate "Customer Types" (Shipper, Consignee, BillTo) using 1 of two methods...
Method 1: Create a CustomerType field in your DimCustomer table and make it an attribute in the customer dimension in your SSAS project...
Method 2: Create a new dimension table (DimCustomerType) and add it to your cube...