Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have a requirement wherein i got to get the sum of values starting from same day last year + 60 days in last year.
for example today is 06/09/2017 so i need to get sum(value) from 06/09/2016 till 09/07/2016.
Any help will be much appreciated.
Thanks in advance
Anupama Jagan
=SUM({<DateFieldName = {'>=$(=AddYears(Today(),-1))<=$(=Date(AddYears(Today(),-1)+60))'}>}Sales)
Hi Jagan
Try the following:
sum({< date_field={'<=$(#=vInitialDate)>=$(#=vFinalDate)'}>} sales)
, where:
vInitialDate = AddMonths(Today(), -12)
vFinalDate = AddMonths(Today(), -12) + 60
Regards,
H
=SUM({<DateFieldName = {'>=$(=AddYears(Today(),-1))<=$(=Date(AddYears(Today(),-1)+60))'}>}Sales)
Hi,
Look attached file
you can try -60 from above examples
...a word of caution - in my experience the AddYears and AddMonths functions often do not work effectively for leap years (ie. where 29th Feb is involved). I prefer to work out the same day last year using the same weekday and same week number from the previous year.