Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I need to calculate sum of views for the previous month based upon the current month selection. I use the expression below but it does not work.
.
=sum({<Month={'$(=(vprevMonth))'}>}Views). It gives the count as 0.
The variable vprevMonth is set as left(MonthName(AddMonths(Date,-1)),3)
Kindly help me with this. Urgent!
Thanks a ton!
HI,
it seems the problem is with left function .. it will return date as string.
try to use date# function as date#(MonthName(AddMonths(Date,-1)) 'MMM')
make sure the date format should be same as Month field..
other this with expression is =sum({<Month={'$(vprevMonth)'}>}Views)...
HTH
Sushil
Hi,
Take the approach as:
=sum({<Month={'$(=Month(AddMonths(Date(Max(Date),'DD/MM/YYYY'), - 1)))'}>}Views)
Regards,
Som