MDX: how to get dimension values as columns

痞子三分冷 提交于 2019-12-25 14:46:15

问题


firstly i apologize because i'm most certainly using the wrong terms here. My problem is that i have the query below that contains a dimension that has always two values (MONTH VALIDATION) as shown on the query and image below:

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

and i get a result like the one below:

My question is: how can i "flatify" this so that i show

|Platoon|Open |Closed|Costs|

|Borg...|12.000|99.000|12+99=111|

that is, transform the values of [MonthValidation] into columns ?


回答1:


Just put the Month Validation Status hierarchy on the columns (that is why there is ON COLUMNS and ON 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


来源:https://stackoverflow.com/questions/26938229/mdx-how-to-get-dimension-values-as-columns

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!