Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Facing some problem with the script I wanted the sale of current month (CM) and previous month (PM) like this as shown below :
sum({<[Month Year]={'Dec-19'}>}GrossSaleAmount)
+
sum({<[Month Year]={'Dec-19'}>}ReturnSaleAmount)
&
sum({<[Month Year]={'Jan-20'}>}GrossSaleAmount)
+
sum({<[Month Year]={'Jan-20'}>}ReturnSaleAmount)
But not able to make it as dynamically .
Please help.
Regards,
Ishan
Hi Kashyap,
Thanks for the expression I have successfully done the expression by creating variables of current month and previous month.
Hi
If you have a date column, try this
Previous Month:
sum({<[Date]={{">=$(=MonthStart(Addmonths(max([Date]),-1)))<=$(=MonthEnd(Addmonths(Max([Date]),-1)))"}}>}GrossSaleAmount)
+
sum({<[Date]={{">=$(=MonthStart(Addmonths(max([Date]),-1)))<=$(=MonthEnd(Addmonths(Max([Date]),-1)))"}}>}ReturnSaleAmount)
Current Month:
sum({<[Date]={{">=$(=MonthStart(Addmonths(max([Date])))<=$(=MonthEnd(Max([Date])))"}}>}GrossSaleAmount)
+
sum({<[Date]={{">=$(=MonthStart(max([Date]))<=$(=MonthEnd(Max([Date])))"}}>}ReturnSaleAmount)
Hope this Helps
Thanks
Hi Kashyap,
Thanks for the expression I have successfully done the expression by creating variables of current month and previous month.