如何在MDX查询中的行上显示多个维度?

问题描述 投票:0回答:1

我在我的立方体中有两个维度称为Sales KGGroupsFormats

反正有没有显示最后一行?

我有这个问题:

select
[Measures].[Sales KG] on Columns,
[Formats].[Format_TT].[Format_TT] on Rows
from [Model]

并且它正在工作,但当我尝试从互联网上关注示例并将其转换为:

select
[Measures].[Sales KG] on Columns,
{ ([Formats].[Format_TT].[Format_TT]), ([Groups].[Group_Name].[Group_Name]) } on Rows
from [Model]

一切都以错误说Elements, tuples and sets in functions must use same hierarchy结束。

我是MDX的新手。我不知道为什么它适用于其他人而且对我没用。 3天前我甚至都不知道它的存在。 enter image description here

mdx rows dimensions
1个回答
1
投票

它给你上面的错误,因为你打破了维度和层次结构。当你写作

{([Formats]。[Format_TT]。[Format_TT]),([Groups]。[Group_Name]。[Group_Name])} MDX翻译你有一个集合(用{}标记),包含两个元组([格式] 。[Format_TT]。[Format_TT]),([Groups]。[Group_Name]。[Group_Name]),每个都用“()”标记。现在问题是SET中的所有元组必须包含相同的层次结构(层次结构原则),加上它们应该是相同的顺序(维度)

select
[Measures].[Sales KG] on Columns,
{ ([Formats].[Format_TT].[Format_TT], [Groups].[Group_Name].[Group_Name]) } on Rows
from [Model]
© www.soinside.com 2019 - 2024. All rights reserved.