Solved

MDX  - 12 trailing months

Posted on 2014-02-06
1
470 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now