Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am using the following expression to calculate between two dates
Sum({<Date ={">=$(vStartDate)<=$(vEndDate)"}>} Price)
I also want to calculate the same period for the previous 12 months
I have tried the following expressions but cannot get them to work.
Sum({<Date={"=Date>=addmonths(vStartDate,-12) and Date<=addmonths(vEndDate,-12)"}>} Price)
Sum({$<Date ={">=$(=Num(AddMonths(vStartDate, -12)))<=$(=Num(AddMonths(vEndDate, -12)))"}>}Price)
Can anybody advise?
Thanks
May be try this
Sum({<Date={"=Only({1} Date) >= AddMonths(vStartDate, -12) and Only({1} Date) <= AddMonths(vEndDate, -12)"}>} Price)
What is the format of your date field? Also, are you making selection in Date or another date and time related fields?
May be try this
Sum({<Date={"=Only({1} Date) >= AddMonths(vStartDate, -12) and Only({1} Date) <= AddMonths(vEndDate, -12)"}>} Price)
Thanks Sunny
This one seems to be working