具有非唯一键的 Sql Server Analysis Services 父子
我目前正在构建我们的数据仓库,主要使用 Ralph Kimball 的方法和指导。
我们为此使用 Microsoft 堆栈(即 SSIS、SSAS)。
我在决定如何处理 BOMS(物料清单)时遇到了一些困难,BOMS 实际上是一个不平衡的层次结构。
BOM 处理的组件是零件的集合。每个零件都可以有自己的子零件,并且每个零件也可以在不同的装配体中多次出现。
我正在尝试使用 DimBOM 表,如下所示...
现在在 SSAS 中,我可以将表连接到自身(ChildItemNumber 到 ItemNumber) )并创建一个维度。该维度将选取关系并创建父子链接。
问题是,本例中的 ItemNumber 不一定是唯一的(因为子项本身可以是父项)。如果我尝试处理维度,SSAS 会警告非唯一属性键。
有没有办法处理这个问题,而不是恢复到分解的层次结构,例如
(来源:bimonkey.com)
I'm currently building our Data Warehouse, primarily using Ralph Kimball's methods and guidance.
We are using the Microsoft stack for this (so SSIS, SSAS).
I am a bit stuck deciding how to handle BOMS (Bill of Materials) which is effectively an unbalanced hierarchy.
The BOM handles assemblies which are a collection of parts. Each part can have it's own child parts and each part can also appear more than once in different assemblies.
I'm trying to use a DimBOM table as follows...
Now in SSAS I can join the table to itself (ChildItemNumber to ItemNumber) and create a dimension. The dimension will pick up the relationship and create a parent-child link.
The problem is, The ItemNumber in this case is not necessarily unique (because a child item can be a parent itself). If I try to process the dimension SSAS warns about a non unique attribute key.
Is there a way of handling this, short of reverting to an exploded hierarchy e.g.
(source: bimonkey.com)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了同样的问题,在我的例子中,从 SAP 表中获取层次结构,经过在互联网上的大量搜索和工作,我找到了解决方案。您可以在我的博客中找到它: http://biwithjb.wordpress.com/
它看起来有点复杂由于 SAP 数据的复杂性,但总的来说非常简单......只是这里和那里的一些技巧;)
希望它有所帮助。
I had the same problem, in my case fetching hierarchies from SAP tables, after much searching on Internet and work I found the solution. You can find it in my blog here: http://biwithjb.wordpress.com/
It looks a bit complicated due to the SAP data complexities, but in the overall is quite simple... just a couple of tricks here and there ;)
Hope it helps.
我认为您可能会混淆这里的两件事:零件和组件。
亲子维度的关键概念之一是,尽管父亲可能有许多子孙,但孩子可能只有一个父母。
所以,我认为这些部分可能是它们自己的父子维度维度,例如:
父键、子键、业务键、名称、金额
null,45,A5286,连杆,
45、51、B1452、螺栓、2
45、52、B5874、杆、1
(如果您需要 2 个螺栓和 1 个杆来构建连杆)
并且组件可能是另一个父子尺寸:
父键、子键、业务键、名称、金额
655、745、E2497、摩托车、2
745、874、E7482、发动机、1
(如果你需要一台发动机来制造一辆摩托车)
并且他们可以以某种方式将可能连接起来,其中:
儿童钥匙零件, 儿童钥匙总成, 数量
45, 874, 3
(如果一台发动机需要 3 个发动机连杆)
始终尝试在最低相关级别进行连接。
无论如何,看看冒险作品的父子维度(企业解决方案有几个),并查看它们的关系表和数据。
希望它能帮助您找到与您相关的答案,
埃拉
I think you might be confusing two things here which are the parts and the assemblies.
one of the key notions in a Parent Child Dimension is that though a father may have many children and grandchildren, a child may only have one parent.
so, i think the parts may be a Parent Child Dimension dimension of their own like:
parent key, child key, business key, name, amount
null, 45, A5286, connection rod,
45, 51, B1452, bolt, 2
45, 52, B5874, rod, 1
(if you need 2 bolts and 1 rod to build a connection rod)
and assemblies may be another Parent Child Dimension:
parent key, child key, business key, name, amount
655, 745, E2497, Motorbike, 2
745, 874, E7482, engine, 1
(if you need 1 engine to build a motorbike)
and they can connect pehaps in a sort of fact where:
child key part, child key assembly, amount
45, 874, 3
(if you need 3 engine rods in one engine)
always try to connect at the lowest relevant level.
in any case, look at adventure works parent child dimension (the enterprise soloution has a few of them) and also look at the relational table and data of them.
hope it helped you find an answer that's relevant for you,
ella