Take the 2-minute tour ×
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. It's 100% free, no registration required.

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
add comment

migrated from stackoverflow.com Dec 20 '11 at 14:09

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

1 Answer

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
add comment

Your Answer

 
discard

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.