vbnetcoder
asked on
MDX Order By
In the following MDX i need to order by [Measures].[ParameterCapti on].....
It IS ordering now but it is doing it by alphabetically ..... i need it to treat [Measures].[ParameterCapti on] as a date and order it that way
WITH MEMBER [Measures].[ParameterCapti on] AS [Accounting Period].[Accounting Period Name].CURRENTMEMBER.MEMBER _CAPTION
MEMBER [Measures].[ParameterValue ] AS [Accounting Period].[Accounting Period Name].CURRENTMEMBER.UNIQUE NAME
MEMBER [Measures].[ParameterLevel ] AS [Accounting Period].[Accounting Period Name].CURRENTMEMBER.LEVEL. ORDINAL
SELECT {[Measures].[ParameterCapt ion], [Measures].[ParameterValue ], [Measures].[ParameterLevel ] } ON COLUMNS,
ORDER( {[Accounting Period].[Accounting Period Name].ALLMEMBERS},[Measure s].[Parame terCaption ], desc) ON ROWS
FROM [MasterCube]
It IS ordering now but it is doing it by alphabetically ..... i need it to treat [Measures].[ParameterCapti
WITH MEMBER [Measures].[ParameterCapti
MEMBER [Measures].[ParameterValue
MEMBER [Measures].[ParameterLevel
SELECT {[Measures].[ParameterCapt
ORDER( {[Accounting Period].[Accounting Period Name].ALLMEMBERS},[Measure
FROM [MasterCube]
ASKER
I'm not sure where/how (very new to MDX) .... would you mind updating the code I posted with what you mean?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ryanmccauley,
When I run that code I get an error:
Parser: The end of the input was reached.
When I run that code I get an error:
Parser: The end of the input was reached.
I'm sorry - I missed the FROM statement at the end of your original MDX. Just add it back to the query and it should work:
WITH MEMBER [Measures].[ParameterCaption] AS
[Accounting Period].[Accounting Period Name].CURRENTMEMBER.MEMBER_CAPTION
MEMBER [Measures].[ParameterValue] AS
[Accounting Period].[Accounting Period Name].CURRENTMEMBER.UNIQUENAME
MEMBER [Measures].[ParameterLevel] AS
[Accounting Period].[Accounting Period Name].CURRENTMEMBER.LEVEL.ORDINAL
SELECT {[Measures].[ParameterCaption],
[Measures].[ParameterValue],
[Measures].[ParameterLevel] } ON COLUMNS,
ORDER( {[Accounting Period].[Accounting Period Name].ALLMEMBERS},
CDATE([Measures].[ParameterCaption]), desc) ON ROWS
FROM [MasterCube]
ASKER
That worked ... thanks!!
ASKER
TY
Open in new window