Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MDX CurrentMamber.Lag - how to force hierarchy level used

Posted on 2010-11-23
1
Medium Priority
?
2,198 Views
Last Modified: 2016-02-15
How do I force the MDX CurrentMember.Lag(N)  method to operate at a particular level of the time hierarchy? I am creating a sales report that mixes weekly figures, monthly figures and yearly figures.  I would like to use the CurrentMember.Lag method to look back a given set of weeks or months for comparison purposes. I think the approach to take is to use is something like this (using AdventureWorks data):

Create member [Measures].[Month Ten Weeks Ago] AS
(
[Date].[Calendar].CurrentMember.Lag(10):[Date].[Calendar]CurrentMember.Lag(7),
[Measures].[Reseller Sales Amount]
)

Or

Create member [Measures].[The Months Ago] AS
(
[Date].[Calendar].CurrentMember.Lag(3),
[Measures].[Reseller Sales Amount]
)

But the report will be filtered for a particular date, so I suspect that these lag methods will be looking back in days rather than weeks or months. Is there a way to force them to use the Time hierarchy level of my choice?
0
Comment
Question by:LinksGu2
[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 15

Accepted Solution

by:
Tim Humphries earned 1000 total points
ID: 34201539
If CurrentMember is at your Date level you could use CurrentMember.Parent to get to the current week and Currentmember.Parent.Parent to get to the month (assuming Month->Week->Date hierarchy).

Also look at the Ancestor function which might be of use to you.

Tim
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

705 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