MDX:如何将维值作为列

时间:2014-11-14 20:23:37

标签: mdx

首先,我道歉,因为我肯定在这里使用错误的术语。我的问题是,我在下面的查询中包含一个维度,该维度始终包含两个值(MONTH VALIDATION),如下面的查询和图片所示:

SELECT NON EMPTY {
    [Measures].[00 - Costs €] 
}
ON COLUMNS, NON EMPTY {(
    [Project Platoon].[Platoon].[Platoon].ALLMEMBERS ,
    [Financial Data Month Validation].[Month Validation Status].[Month Validation Status].ALLMEMBERS
)} 
DIMENSION PROPERTIES 
    MEMBER_CAPTION,MEMBER_UNIQUE_NAME ON ROWS 
    FROM 
        [DataCube] 
        CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

我得到的结果如下:

image

我的问题是:我怎样才能打扮出来?#34;这样我就显示了

|排|打开|关闭|费用|

|博格... | 12.000 | 99.000 | 12 + 99 = 111 |

即,将[MonthValidation]的值转换为列?

1 个答案:

答案 0 :(得分:1)

只需将Month Validation Status层次结构放在列上(这就是ON COLUMNSON ROWS的原因):

SELECT NON EMPTY {
    [Measures].[00 - Costs €] 
} *
[Financial Data Month Validation].[Month Validation Status].[Month Validation Status].ALLMEMBERS
ON COLUMNS,

NON EMPTY {
    [Project Platoon].[Platoon].[Platoon].ALLMEMBERS 
} 
DIMENSION PROPERTIES 
    MEMBER_CAPTION,MEMBER_UNIQUE_NAME ON ROWS 
    FROM 
        [DataCube] 
        CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS