如何在MDX查询中的行上显示多个维度? [英] How to display multiple dimensions on rows in MDX query?
问题描述
我在多维数据集中有一个名为 Sales KG
的度量,并且有两个维度: Groups
和 Formats
.
I have measure called Sales KG
in my cube and two dimensions: Groups
and Formats
.
反正有最后一行显示吗?
Is there anyway to display last ones in single row?
我有这个查询:
select
[Measures].[Sales KG] on Columns,
[Formats].[Format_TT].[Format_TT] on Rows
from [Model]
它正在工作,但是当我尝试遵循Internet上的示例并将其转换为:
and it's working, but when I try to follow examples from Internet and turn it into:
select
[Measures].[Sales KG] on Columns,
{ ([Formats].[Format_TT].[Format_TT]), ([Groups].[Group_Name].[Group_Name]) } on Rows
from [Model]
一切都以错误结尾,即函数中的元素,元组和集合必须使用相同的层次结构
.
Everything ends with error saying that Elements, tuples and sets in functions must use same hierarchy
.
我是MDX的新手.我不知道为什么它对其他人有用,对我却无用.3天前,我什至不知道它的存在.
I am new to MDX. I don't know why it works for others and no work for me. 3 days ago I didn't even knew about it's existence.
推荐答案
由于您破坏了维度和层次结构,它给了您上面的错误.当你写
It is giving you the above error because you are breaking dimensionality and hierarchility. When you write
{ ([Formats].[Format_TT].[Format_TT]),
([Groups].[Group_Name].[Group_Name]) }
MDX表示您有一个包含两个元组的集合(用{}标记)([Formats].[Format_TT].[Format_TT]),([Groups].[Group_Name].[Group_Name])
,以()"标记每个.现在的问题是,SET中的所有元组必须包含相同的层次结构(层次结构原理),而且它们的顺序也应相同(维度)
MDX translates that you have a set (marked by {}), containing two tuples ([Formats].[Format_TT].[Format_TT]),([Groups].[Group_Name].[Group_Name])
, marked by "()" each. Now the issue is all the tuple in a SET must contain then same hierarchies(The principle of hierarchility), plus they should be in the same order (Dimensionality)
select
[Measures].[Sales KG] on Columns,
{ ([Formats].[Format_TT].[Format_TT], [Groups].[Group_Name].[Group_Name]) } on Rows
from [Model]
这篇关于如何在MDX查询中的行上显示多个维度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!