Solved

MDX  - 12 trailing months

Posted on 2014-02-06
1
482 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hive vs Impla in Hadoop 1 72
Display field if column exists 7 31
SQL to JSON 14 30
SSRS 2016 Parameter Search on a long list id 8 18
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
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…

735 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