![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Greetings, This question is about how to achieve the desired labeling in the results of an MDX query, via the ExecuteCellSet method of AdomdCommand object (.NET v2) working against an Analysis Services 2005 cube (SP1). I am asked to run an MDX query and then to export the results to an Excel spreadsheet for further processing. Two dimensions have been selected along the columns and the time dimension is wanted down the rows, with a couple of measures for data. For the time dimension, although we have data down to date granularity, this takes too long to compute, so we wish to get just the year and month levels. For the measures of interest, the value for the last day of the month is that for the month as a whole. Assuming just the one measure (M1), the layout of the resulting cellset looks like: All All All Africa Africa Africa Asia Asia Asia etc All Male Female All Male Female All Male Female etc M1 M1 M1 M1 M1 M1 M1 M1 M1 etc 2002 January February March April May June July August September October November December 2003 January February March April May June |
#3
| |||
| |||
|
|
You could get the lastchild members by doing something like: GENERATE({[Dim Time].[Calendar Year - Month - Date].[Month].Members}, {[Dim Time].[Calendar Year - Month - Date].CurrentMember.LastChild) ON ROWS But this would also get you the daily values, not the monthly values. To get the month value you would need to create a calculated measure to replace "M1" in order to get the value from the month level. eg. WITH MEMBER Measures.M1Monthly AS (Measures.M1,[Dim Time].[Calendar Year - Month - Date].CurrentMember.Parent) -- Regards Darren Gosbell - SQL Server MVP Blog: http://www.geekswithblogs.net/darrengosbell In article <CAC2396A-B7A7-4327-876F-D10DBD82A9DB (AT) microsoft (DOT) com>, SebastianCrewe (AT) discussions (DOT) microsoft.com says... Greetings, This question is about how to achieve the desired labeling in the results of an MDX query, via the ExecuteCellSet method of AdomdCommand object (.NET v2) working against an Analysis Services 2005 cube (SP1). I am asked to run an MDX query and then to export the results to an Excel spreadsheet for further processing. Two dimensions have been selected along the columns and the time dimension is wanted down the rows, with a couple of measures for data. For the time dimension, although we have data down to date granularity, this takes too long to compute, so we wish to get just the year and month levels. For the measures of interest, the value for the last day of the month is that for the month as a whole. Assuming just the one measure (M1), the layout of the resulting cellset looks like: All All All Africa Africa Africa Asia Asia Asia etc All Male Female All Male Female All Male Female etc M1 M1 M1 M1 M1 M1 M1 M1 M1 etc 2002 January February March April May June July August September October November December 2003 January February March April May June |
![]() |
| Thread Tools | |
| Display Modes | |
| |