In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

datetimeformat in a file name

KateC
8 - Asteroid

TOSTRING(DATETIMEFORMAT(DATETIMENOW(),-1, "MONTHS","%B %Y"

 

I want to save a file that is produced on the first business day with the previous month appended to the end. So on June 1 the file should be saved as "Excel File May 2021".  I'm getting a parse error so I've got something out of order here in my expression. Probably the -1, "months" in datetimeformat?  It can't be difficult to do this but I still struggle with these kinds of expressions. Looking for suggestions. Thanks!

2 REPLIES 2
Luke_C
17 - Castor
17 - Castor

Hi @KateC 

 

Try adding a datetimeadd to your formula, the below seems to return "May 2021"

 

TOSTRING(DATETIMEFORMAT(datetimeadd(DATETIMENOW(),-1, "MONTHS"),"%B %Y"))

KateC
8 - Asteroid

That's exactly what I wanted. Thank you!

Labels
Top Solution Authors