Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a MDX query which syntax is familiar to me:

SELECT NON EMPTY { [Measures].[Amount] } ON COLUMNS, 
       NON EMPTY { ([Projects].[Id].[Id].ALLMEMBERS * [Priorities].[Id].[Id].ALLMEMBERS ) }     
FROM [Reports]         
WHERE [CreatedOn].[Date].&[2010-01-01T00:00:00]:[CreatedOn].[Date].&[2010-02-01T00:00:00]

But I can rewrite the query such way:

SELECT NON EMPTY { [Measures].[Amount] } ON COLUMNS, 
NON EMPTY { ([Projects].[Id].[Id].ALLMEMBERS * [Priorities].[Id].[Id].ALLMEMBERS ) } ON ROWS 
FROM (SELECT [CreatedOn].[Date].&[2010-01-01T00:00:00]:[CreatedOn].[Date].&[2010-02-01T00:00:00] ON COLUMNS
FROM [Reports])

New query returns the same results, but FROM section looks obscure to me. How query can have two FROM section? Where can I find information about this syntax?

share|improve this question

migrated from Dec 20 '11 at 14:09

This question came from our site for professional and enthusiast programmers.

up vote 2 down vote accepted

Recent versions of SSAS (IIRC 2008+) support subqueries in MDX in much the same way that SQL does. What you see here is a subquery being used to produce a subcube that is then queried by the outer query. There's an article on it here.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.