We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun 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