[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

SQL 2008 SSAS MDX formula

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
AXISHK
Asked:
AXISHK
  • 2
  • 2
1 Solution
 
Phillip BurtonDirector, Practice Manager and Computing ConsultantCommented:
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
 
AXISHKAuthor Commented:
attached the data dimension for your reference. Tks
DateDimension.png
0
 
Phillip BurtonDirector, Practice Manager and Computing ConsultantCommented:
Yes, I've seen that. My question was:

Is that reflective in what you see as the result?
0
 
AXISHKAuthor Commented:
Correct, tks
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now