2 weeks ago - last edited 2 weeks ago
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.
2 weeks ago - last edited 2 weeks ago
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
2 weeks ago
To stick with your current formula you can do this:
=(today - 1.months).in_time_zone("America/New_York").strftime(" %B %Y ")
a week ago
This is great!
2 weeks ago - last edited 2 weeks ago
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