I am using Variable Expression. I would like to get the function to help get previous month and year. Especially when execution is Jan , i would like to get previous month dec
Below are the current functions i am using:
currentyear = (getYear(now())).toString().slice(-2) > this will return 23
currentMonth = (“0” +getMonthOfYear(now())).slice(-2) > this will return 01
join(currentyear,currentMonth) > this will return 2301
Now i would like to get previous month & year: 2212
Very nice @gonhaddock , I didn’t know you could do this in the Interval “P-1M”. What does “P” mean or stand for (I can guess that it’s the current date, or is it the date that’s generated as “Starting Point” in the config above the “Ending Point”)?
EDIT: Forgot to add: What I don’t like about doing -1 Month is that there are some special cases where this might not work. This is just a theory as I’ve not tested it. What happens if you are on March 31st? What’s the result if you do March 31 - 1 month? Does it return February 28/29?