| How in the report can I order date dimension members in descending order? |
| Written by Vidas Matelis | |||||||||||||||||||
| Friday, 04 April 2008 00:48 | |||||||||||||||||||
|
Q: How in the report can I order date dimension members in descending order? A: By default Analysis Services returns members in an order specified during attribute design. Attribute properties that define ordering are "OrderBy" and "OrderByAttribute". Lets say we want to see order count for the last 3 years. In Adventure Works MDX query would be:
And the result for this query is:
In the results above years are ordered in ascending order 2002, 2003 and 2004. If we want to get results ordered in descending order, we can use MDX function ORDER. This function has following parameters (copied from BOL):
As we want to order dimension members in a descending order, we can use the Member_Key property for Numeric_Expression and use DESC flag to order in descending order. So new MDX query is:
And new result:
|
Most read
- How to install Adventure Works SQL DW and Analysis Services 2005/2008 sample database and project
- MDX-How can I get Last (Previous) Year to Date (YTD) values?
- Analysis Services 2005 error: Errors in the metadata manager. The attribute with ID of ., Name of . refer
- MDX-How do you format or round KPI expression value?
- MDX-How do you calculate monthly average of one year, optionally including empty months?
Top Rated
- How to install Adventure Works SQL DW and Analysis Services 2005/2008 sample database and project
- Analysis Services 2005 XMLA script to add/drop existing partition aggregate
- Why In Reporting Services MDX query disappears after leaving "Data" tab.
- When accessing calculation tab in BIDS I am getting error Unexpected error occurred
- In an MDX query how can I get the top 3 sales years based on the order quantity?
- What TCP port SQL Server Analysis Services 2005 uses
- How to calculate YTD monthly average and compare it over several years for the same selected month
- Analysis Services 2005 error: Errors in the metadata manager. The attribute with ID of ., Name of . refer




