Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to compare qty of today, and that of 2 months ago.
dimension: item, location, month
Used set analysis: sum({$<Month={'$(=AddMonths(Month,-2))'}>}[Total Qty])
not working. did I do something wrong?
Try This if your Month Dimension is like 'Jan', 'Feb' etc
=SUM({$<Month = {'$(=Month(Today())-2)'}>}[Total QTY])
Or try this if Month is in Numeric Form
=SUM({$<Month = {'$(=month(AddMonths(now(0), -2)))'}>}[Total QTY])
How do I do a rolling 2 months? In Dec, I want to see that of Oct, in Nov, I want to see Sep
didn't work for me.
say april is 10, may is 15, jun is 20.
I want to use jun/april. july/may, aug/jun....
Hi.
You can't roll with set analysis, because the set is calculated once for all dimension values.
As you include month as dimension, you can try to use inter-record functions like above/before. Though this approach has some issues if months are not continuous.
Another way is to calculate the sums for 2 moths ago in script.
You can write below code in script to get the two month before data.
Month(AddMonths(TempDate,-2)) | as Month2, |
Now Use Month2 List BOX and below CODE...
=SUM([Total QTY])
Hi,
Try this, if you have date field in your data model, use separate expressions for each 2 months like this
For Dec-2013
set vMaxDate = MakeDate(2013, 12);
For Oct-2013 & Nov-2013
=Sum({$<Month=, Year=, Quarter=, DateDimensionName={'>=$(=MonthStart(vMaxDate, -2))<=$(=MonthEnd(vMaxDate, -1))'}>}[Total Qty])
For Aug-2013 & Sep-2013
=Sum({$<Month=, Year=, Quarter=, DateDimensionName={'>=$(=MonthStart(vMaxDate, -4))<=$(=MonthEnd(vMaxDate, -3))'}>}[Total Qty])
For Jun-2013 & Jul-2013
=Sum({$<Month=, Year=, Quarter=, DateDimensionName={'>=$(=MonthStart(vMaxDate, -6))<=$(=MonthEnd(vMaxDate, -5))'}>}[Total Qty])
Regards,
Jagan.