SSAS:父子层次结构

发布于 2024-09-26 09:00:38 字数 996 浏览 2 评论 0原文

父子层次结构

在多维数据集中表示父子层次结构的最佳方式是什么?我已经看到了可以作为父级应用的用法。 我已经应用了这个,例如

ID ParentID CompanyName Rank
1 1 AAA 优秀
2 1 BBB 好
3 1 CCC 好的
4 1 DDD 无

我可以通过将 ParentID 设置为 Parent 的用途来适当链接 ID 和 ParentID 用途。我还设置了父键,这样,如果公司滚动到自身,它不会将父键显示为其自己的子键(NonLeafDataHidden)。

当在多维数据集浏览器/Excel 中仅使用 CompanyName 时,这可以正常工作。

当尝试引入其他属性(例如排名)时,就会出现问题。

将以下内容拖到多维数据集浏览器中:
-(母公司、公司...层次结构)、排名 - 如果排名位于表格末尾,Cube Browser 根本不显示排名列,仅显示标题。
- 排名,(母公司、公司...层次结构) - 如果排名位于表的开头,多维数据集浏览器将正确显示。

在 Excel 中, -(母公司、公司...层次结构)、排名 - 如果排名位于表格末尾,Excel 不会显示母公司的排名,但会在第二行显示子公司的排名。通过在第二行显示排名 - 任何测量也会重复:

AAA 73 - 此处对于 AAA,排名不显示。测量结果正确,孩子 23,家长 50
BBB 10 - 重复测量 10
好 10 CCC 8 - 重复测量 8
好的 8
DDD 5 - 重复措施 5
无 5

  • 排名,(母公司、公司...层次结构) - 如果排名位于表的开头,Excel 会正确分组并正确求和。尽管母公司仍会出现在每个级别中,因为它有处于该特定级别的子公司,但该措施仅适用于该级别的子公司。

引入父子层次结构属性的最佳方式是什么?从我上面看到的问题来看,我很想使用命名查询创建一个新表(母公司),并直接使用 ParentID 加入该表 - 有效地使用别名。

Parent-Child Hierarchy

What's the best way to represent a Parent-Child hierarchy in the Cube? I've seen the Usage that can be applied as Parent.
I've applied this, for example,

ID ParentID CompanyName Rank
1 1 AAA Excellent
2 1 BBB Good
3 1 CCC Ok
4 1 DDD None

I can link the ID and ParentID Usage appropriately by setting the ParentID to a Usage of Parent. I've also set the Parent Key, so that if the Company rolls up to itself, it doesn't show the Parent as its own child (NonLeafDataHidden).

When using only the CompanyName in the Cube Browser / Excel, this is working okay.

The problem occurs when trying to bring in other attributes, such as Rank.

Dragging the following into the Cube Browser:
- (Parent Company, Company...hierarchy), Rank - If the Rank is at the end of the table, Cube Browser doesn't show the Rank column at all, only the heading appears.
- Rank, (Parent Company, Company...hierarchy) - If the Rank is at the start of the table, Cube Browser displays correctly.

In Excel,
- (Parent Company, Company...hierarchy), Rank - If Rank is at the end of the table, Excel doesn't display the Rank of the Parent Company, but does display the Rank of the Child Companies on a second line. By displaying the Rank on a second line - any measures also get repeated:

AAA 73 - here for AAA the Rank is not showing. The measure is correct, 23 from the Child and 50 for the Parent
BBB 10 - repeated measures 10
Good 10
CCC 8 - repeated measures 8
Ok 8
DDD 5 - repeated measures 5
None 5

  • Rank, (Parent Company, Company...hierarchy) - If Rank is at the start of the table, Excel groups correctly and sums correctly. Although, the Parent Company will still appear in each of the Ranks, as it has children that are in that particular Rank, but the Measures will only be from the Children that are in that Rank.

What is the Best way to bring Attributes of a Parent-Child Hierarchy? From the issues I've seen above, I'm tempted to go a create a new Table (Parent Company) using Named Query and join to this directly with the ParentID - effectively Aliasing.

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

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

发布评论

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

评论(1

苦妄 2024-10-03 09:00:38

我发现了一些原因,解释了在 PC 层次结构中包含附加属性时发生某些事情的原因:

  • 注意,我已经设置了父密钥,这样,如果公司滚动到自身,它就不会显示 注意,行结构
  • 示例为:PC 层次结构、排名、度量

1) 在 Cube Browser 中,这取决于您在层次结构中的哪个阶段包含附加属性。
例如,如果行结构仅包含PC 层次结构和Measure,然后您不断展开层次结构,直到看到Total(即层次结构的最低级别)。然后通过在这个阶段添加Rank属性,使Row结构变成:PC层级、Rank、Measure,出现Rank属性标题,但Row中不出现详细信息。如果双击空单元格,您会收到消息:“无法钻取全部成员”。

如果您没有完全展开行结构,因此在上面提供的示例中仅展开一级,则此时添加 Rank 属性 - 这将显示 Rank 属性详细信息。

这样,在Cube Browswer中看不到Rank属性的问题就解决了。

2) 现在,出现了无法看到父级属性的问题,因为层次结构的设置使得如果公司滚动到自身,它不会将父级显示为其自己的子级。例如,多维数据集浏览器中的结果:

父 ---------- 子 ---------- 排名

AAA ---------- BBB ---------- 良好

AAA --- ------- CCC ---------- 好的

AAA ---------- DDD ---------- 无

我希望看到 AAA 是被评为优秀,所以我想解决这个问题的唯一方法就是向孩子展示它本身就是父母。
我想这已解决以显示以下内容:

Parent -------- Child -------- Rank

AAA ----------- AAA -------- -- 优秀

AAA ----------- BBB ---------- 良好

AAA ----------- CCC ---------- Ok

AAA ----------- DDD ---------- None

  • 注意,下面的示例现在将使用上述方法。

3) 重复测量 - 我们如何只显示一次测量?这是多维数据集浏览器中显示的内容,每个子层次结构级别后面都有一个总计,还有该级别的度量详细信息 - 在本例中它是相同的,因此是重复的。最后,还有一个 GrandTotal。同样,在 Excel 中也可以看到重复测量的问题。我只想显示 Total / GrandTotal 级别 - 这可能吗?

父级 ----------- 子级 ----------- 排名 ----------- 测量

AAA ------------ --- AAA ------------ 优秀 -------- 50

AAA --------------- AAA -------- ----- 总计 ------------ 50

AAA --------------- BBB ------------ 好 - ------------ 10

AAA --------------- BBB ------------ 总计 -------- ----- 10

AAA --------------- CCC ------------ 好的 -------------- -- 8

AAA --------------- CCC ------------ 总计 ------------- 8

AAA -- ------------- DDD ------------ 无 -------------- 5

AAA -------- -------- DDD ------------ 总计 ------------- 5

总计 ------------- ------------------------------- 73

在 Excel 中,它表现为属性位于单独的行上并且度量仍然重复,对于每一行:

父级 ----------- 子级 ----------- 排名 ----------- 测量

AAA ------- ------------------------------------------ 73

AAA ------ --------- AAA ----------------------------- 50

AAA --------- ------ AAA ------------ 优秀 ------ 50

AAA ------------------ BBB ------ ----------------------- 10

AAA --------------- BBB --------- --- 良好 ----------- 10

AAA --------------- CCC ----------------- ------------- 8

AAA --------------- CCC ------------ 好的 ------ -------- 8

AAA --------------- DDD ------------------------ ------ 5

AAA --------------- DDD ------------ 无 ------------ 5

有没有办法消除重复的措施?

谢谢

I've found a couple of things for the reasons why certain things are happening when including additional attributes to a P-C hierarchy:

  • Note, I've set the Parent Key, so that if the Company rolls up to itself, it doesn't show the Parent as its own child
  • Note, Row structure example is: P-C hierarchy, Rank, Measure

1) In Cube Browser, it depends at what stage in the hierarchy you include the additional attribute.
e.g. If the row structure only contains P-C hierarchy and Measure and then you continually expand the hierarchy until you see Total (ie lowest level of the hierarchy). Then by adding the Rank attribute at this stage, so that the Row structure becomes: P-C hierarchy, Rank, Measure, the Rank attribute header appears, but no details appear in the Row. If you double-click the empty cell, you get the message : "Cannot drill into a total member".

If you don't expand the row structure completely, so only expand one level in the example I've provided above, then at this point add the Rank attribute - this will show the Rank attribute details.

So, this issue of not being able to see the Rank attribute in Cube Browswer, is resolved.

2) Now, comes the issue of not being able to see the Parent attributes, as the hierarchy is setup so that if the Company rolls up to itself, it doesn't show the Parent as its own child. E.g. Results in Cube Browser:

Parent ------- Child ------- Rank

AAA ---------- BBB ---------- Good

AAA ---------- CCC ---------- Ok

AAA ---------- DDD ---------- None

I would like to see that AAA is Ranked as Excellent, so the only way to get around this I guess is to show the Child where it is itself a Parent.
I guess this is resolved to show the following:

Parent -------- Child -------- Rank

AAA ----------- AAA ---------- Excellent

AAA ----------- BBB ---------- Good

AAA ----------- CCC ---------- Ok

AAA ----------- DDD ---------- None

  • Note, following examples will now use the above approach.

3) Repeating Measures - how do we only show measures once? This is what is shown in Cube Browser, there's a Total after each Child Hierachy level, there's also the Measure details of the level - in this case it's the same, so it's repeated. Then finally, there's a GrandTotal. Again this issue of the Measure repeating is also seen in Excel. I would like only the Total / GrandTotal levels to be displayed - is this possible?

Parent ----------- Child ----------- Rank ----------- Measure

AAA --------------- AAA ------------ Excellent -------- 50

AAA --------------- AAA ------------ Total ------------ 50

AAA --------------- BBB ------------ Good ------------- 10

AAA --------------- BBB ------------ Total ------------ 10

AAA --------------- CCC ------------ Ok ---------------- 8

AAA --------------- CCC ------------ Total ------------- 8

AAA --------------- DDD ------------ None -------------- 5

AAA --------------- DDD ------------ Total ------------- 5

GrandTotal -------------------------------------------- 73

In Excel it comes through as the attributes on a separate line and the measures are still repeated, for each line:

Parent ----------- Child ----------- Rank ----------- Measure

AAA ------------------------------------------------- 73

AAA --------------- AAA ----------------------------- 50

AAA --------------- AAA ------------ Excellent ------ 50

AAA --------------- BBB ----------------------------- 10

AAA --------------- BBB ------------ Good ----------- 10

AAA --------------- CCC ------------------------------ 8

AAA --------------- CCC ------------ Ok -------------- 8

AAA --------------- DDD ------------------------------ 5

AAA --------------- DDD ------------ None ------------ 5

Is there a way to remove the repeating of the Measures?

thanks

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