Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello people
I have created date field using this expression,
Date( MakeDate( left(acc_period,4) , right(acc_period,2) ) , 'YYYY-MM' )
I have a requirement to display previous month sales based on the selected Date. I used the below exp for previous month sales,
=Sum({$<Date={"$(=Max(Date)-1)"}>}sales)
But it is not working. Please help me to solve this issue.
Date format - YYYY-MM (2018-12)
Sum({$<Date={"$(=Date(AddMonths(Max(Date),-1),'YYYY-MM'))"}>}sales)
Hi ,
Derive a separate month field from your Date field and construct your expression .
Sum({$<Date={"$(=Date(AddMonths(Max(Date),-1),'YYYY-MM'))"}>}sales)
Create a column named MonthSerial using
(num#( left(acc_period,4))*12) + num#( right(acc_period,2)) as MonthSerial
then use
=Sum({<MonthSerial={$(=(Max(MonthSerial)-1))}>}sales)
for previous month sales
Thanks. Exp is working.
What is acc_period in your equation?