Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Issue regarding MDX Query

Author  Topic 

Ciber2010
Starting Member

5 Posts

Posted - 2011-01-28 : 06:44:01
SELECT NON EMPTY { [Measures].[Record Count - Dim Employee AS] } ON COLUMNS, NON EMPTY { ([Date].[H_CalendarWeekHierarchy].[Calender Week].ALLMEMBERS * [Date].[Week ID].[Week ID].ALLMEMBERS * [Date].[Month ID].[Month ID].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM [Cube_Employee] CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS



The Sample Results of the above query are shown below with 2 rows but the requirement is to pick only one row which has the Maximum Week_ID irrespective of number of Week_ID’s available


CalenderYear CalenderWeek Week_ID Month_ID Record Count
2011 4 1621 373 2332
2011 5 1622 373 2332


Please Give any MDX Query to get the result based on the max Week_ID

Thanks in advance
   

- Advertisement -