Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am having a requirement where I need to place values for current month vs previous month
FIELD1 | Date (Year month format) |
A | 202009 |
B | 202010 |
C | 202011 |
D | 202012 |
E | 202101 |
I have variable set for value in current month, however I am not able to create a proper expression for getting the values from the pervious Year Month. Mainly because of Jan to Dec. If I use 202101 as current Year Month for example, I am getting 202100 as Previous Year Month Date. What expression can I use for when current year month is 202101, the previous year month date will show as 202012?
By the looks of it your date field is not a date, but an integer. Therfore you can not use date funtions like addmonth() on it without manipulating it a bit. Try something like this to get prev month.
Num(Text(Date(Addmonths(date#([Date Field], 'YYYYMM'), - 1), 'YYYYMM')))
Hello,
Hope this helps you!!
In Frontend Expression:
=date(Addmonths(date#([Date(Year month format)], 'YYYYMM'), - 1),'YYYYMM')
Regards,
Bhavya