โ12-09-2024 12:28 PM - edited โ12-09-2024 12:32 PM
I have a report that has data up to the end of previous calendar month. I want to email it, with the subject line saying "Report as of November 2024"
I can get December 2024 with this:
=today.in_time_zone("America/New_York").strftime(" %B %Y ")
But can't figure out how to subtract 1 month from it Where do I put "- 1.months" without a syntax error ?
Solved! Go to Solution.
โ12-09-2024 09:12 PM - edited โ12-09-2024 09:41 PM
Hi @dunncrew ,
As per the requirement you need always a month ago ( i.e. if current month December then requirement to get November). Please correct me.
in that case we can use directly "1.months.ago.in_time_zone("America/New_York").strftime(" %B %Y ")" to simply the solution.
Thanks and Regards,
Shivakumar K A
โ12-09-2024 09:19 PM
To stick with your current formula you can do this:
=(today - 1.months).in_time_zone("America/New_York").strftime(" %B %Y ")
โ12-13-2024 12:53 PM
This is great!
โ12-10-2024 05:57 AM - edited โ12-10-2024 08:14 AM
Thanks for both suggestions. At first it appeared your suggestions did not work.
I found a "bug" that if the variable was "DATE" type, changed to "STRING" , Workato remembers it used to be DATE and doesn't work, so I had to create new variables