Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to calculate the last month sales values?
Eg:
=Sum({$<Year={$(=Max(Year))},MonthID={$(=Max(MonthID))}>}PrimarySales)
this above expression is currents month sales
Stephan ,
See the attachment.
Thanks,
AS
Hi,
If you have date field try like this
=Sum({$<Year=,MonthID=, DateDimensionName={'>=$(=MonthStart(Max(DateDimensionName), -1))<=$(=MonthEnd(Max(DateDimensionName), -1))'}>} PrimarySales)
Hope this helps you.
Regards,
Jagan.
Dears,
=Sum({$<Year={$(=Max(Year))},MonthID={$(=Max(MonthID-1))}>}Sales)
this above expression is correct or wrong for the last month sales
Hi,
Let us assume if you select 2014 and Month as january then your expression will return
Null value because 1(Jan) - 1 gives you zero.
Hope this helps you.
Regards,
Jagan.
Dear jagan
This kind of situation how to take the 2013 Dec values?
Regards,
Stephen Edberk
Hi,
If you don't have date field then arrive the date field in script like below
LOAD
*,
MakeDate(Year, MonthID) AS DateDimensionName
FROM DataSource;
Now use below expression for getting the last month sales
=Sum({$<Year=,MonthID=, DateDimensionName={'>=$(=MonthStart(Max(DateDimensionName), -1))<=$(=MonthEnd(Max(DateDimensionName), -1))'}>} PrimarySales)
Hope this helps you.
Regards,
Jagan.