Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

MDX Help with 'Lag'

$
0
0
OK.  I have a dimension Years that needs an additional non traditional year added.  Current formula just goes back one year for 'Units' in the 'Scenario_A' dimension on 'Units' Account.

Current Formula:

([Scenario_A],PrevMember(Years.CurrentMember),[Units]).Value

So now I need a little logic added.  If the 'Years' equals '2012_New' then go back 2 Years for 'Units' for 'Scenario_A', else go back 1 Year.  I'm trying below, but somehow don't I need 'Units' and 'Scenario_A' in there?

iif(Years.CurrentMember Is [2012_New], Years.CurrentMember.Lag(2), Years.CurrentMember.PrevMember)

Viewing all articles
Browse latest Browse all 2472

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>