Understanding Lag()
Hi,
I have 2 rules as follows
Rule 1:
LagSales = lag(WPSales)
Rule 2:
BuildRatio = if (LagSales == 0, 1, WPSales/LagSales)
WPSales = BuildRatio*LagSales
The base intx of these measures are week_skup_chnl. BuildRatio has a spread of recalc.
I observed that it calculates correctly at week_skup_chnl.However when I view at month_skup_chnllevel, the values are incorrect.
For eg, the sales for month 1 is 3300 and for month 2 its 6600, am expecting a build ratio of 2 for month 2, instead it shows me some other value such as 1.11.
I am expecting the lag to consider previous month (month 1) while calculating the build ratio for month 2.