Solved

MDX Query Order by Date

Posted on 2013-01-18
3
454 Views
Last Modified: 2013-01-28
How would i update this MDX to order by a field -- YearMonth

WITH MEMBER [Measures].[ParameterCaption] AS [Sales Period].[Sales Period Name].CURRENTMEMBER.MEMBER_CAPTION MEMBER [Measures].[ParameterValue] AS [Sales Period].[Sales Period Name].CURRENTMEMBER.UNIQUENAME MEMBER [Measures].[ParameterLevel] AS [Sales Period].[Sales Period Name].CURRENTMEMBER.LEVEL.ORDINAL SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , [Sales Period].[Sales Period Name].ALLMEMBERS ON ROWS FROM [MasterCube]
0
Comment
Question by:vbnetcoder
  • 2
3 Comments
 
LVL 28

Accepted Solution

by:
Ryan McCauley earned 500 total points
ID: 38813342
The value you're ordering would have to be somewhere in the query (I assume it's part of the "Sales Period" dimension you're working with), and the you'd use the ORDER() function.

http://msdn.microsoft.com/en-us/library/ms145587.aspx
0
 

Author Comment

by:vbnetcoder
ID: 38813987
It's not in the query and i am not sure how to add it ... that is a part of my problem...
0
 

Author Closing Comment

by:vbnetcoder
ID: 38827320
ty
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
T-SQL: Episode III - Revenge of The Dude 24 53
SQL Replication question 9 42
sql server insert 12 30
sql 2008 how to table join 2 15
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question