Solved

SQL 2008 SSAS MDX formula

Posted on 2014-12-16
4
177 Views
Last Modified: 2016-02-18
What's the purpose of 'ANCESTOR' and .lag(1) used in the following mdx formula ? I have attached our current data dimension for reference, Tks


([Measures].[BaseAmount],ANCESTOR( [DIM DATE].[Year Group].CurrentMember, [DIM DATE].[Year Group].[Year] ).lag(1))
DateDimension.png
0
Comment
Question by:AXISHK
[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
  • 2
  • 2
4 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40502167
It would appear that it is giving you the BaseAmount for the whole year before where you currently are:

Where are you currently in the Year Group hierarchy? Wherever it is, go back up to the Year. (So, if you were in 14 Feb 2014, go to the year 2014). (That's the ANCESTOR.)

Then go back a year (so, go to the year 2013). (That's the LAG)

Is that reflective in what you see as the result?
0
 

Author Comment

by:AXISHK
ID: 40502384
attached the data dimension for your reference. Tks
DateDimension.png
0
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40502386
Yes, I've seen that. My question was:

Is that reflective in what you see as the result?
0
 

Author Closing Comment

by:AXISHK
ID: 40503941
Correct, tks
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.

749 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