Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all
How to Calculate value of last 3 months values.
For example on this January 2015, it will calculate December, November, October 2014 value.
Regards
Sofyan B
Hi,
In any chart try this expression
=Sum({<Date = {'>$(=Max((Addmonths(Date,-3)))) <$(=Max (Addmonths(Date,-1)))'}>} Sales)
Or
=Sum({<DateField = {'>$(=Max((Addmonths(DateField,-3)))) <$(=Max(Addmonths(MonthEnd(DateField),-1)))'}>} Sales)
Regards
Anand
Hi Anand
Thanks for your respond
I don't have date column on data there's only year and month column.
Regards
Sofyan B
Hi,
In which format your Month and Year fields have better to add Monthyear field in load script or NUM month field.
Regards
Anand
here you have an example
Please have a look on this. Hope it will help.
Hi Anand
I wrote this expressions
=Sum({<TransDate= {'>$(=Max((Addmonths(Today(),-3)))) <$(=Max(Addmonths(MonthEnd(Today()),-1)))'}>} Sales_Nett)
it returns 0
Any Suggestion
Regards
Sofyan B
Hi,
Your expression is correct and it gives output also some little change use Monthstart with addmonths also
=Sum({<TransDate= {'>=$(=Max(Monthstart(AddMonths(Today(),-3))) ) <$(=Max(Addmonths(MonthEnd(Today()),-1)))'}>} Sales_Nett)
Regards,
Anand