Solved

MDX  - 12 trailing months

Posted on 2014-02-06
1
480 Views
Last Modified: 2014-02-06
I need an MDX WHERE clause that will give me the selected date and the 11 preceding.  For example, select January 2014 and get Feb 2013 - Jan 2014.

Is there a DateDiff or something that I can use in the WHERE clause in MDX for this kind of query?

I have found LastPeriods:
WHERE (LastPeriods(12.0, [Dim Date.MonthNum].[11]))

But ... nothing there specifies the year.

Thanks!
0
Comment
Question by:Daniel Wilson
1 Comment
 
LVL 32

Accepted Solution

by:
Daniel Wilson earned 0 total points
ID: 39839763
OK, I think I have it:

WHERE (LastPeriods(366.0, [Dim Date.FullDate].[2013-11-30])

This seems to go back 366 days ... spanning the 12 months I want.
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Creating and Managing Databases with phpMyAdmin in cPanel.
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

839 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