问题
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