Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

How to automatically populate dynamic past date on email subject line

czjames87
8 - Asteroid

I am trying to add a past date on an automated report that runs every thursday. I am needing to add the previous saturday's date to the subject line. So every thursday that it runs it needs to show "Report Name" - Previous Saturday's date. For example, this weeks report should have the subject: Report Name - 4/29/23. Currently I have the logic below in place but it only gives me the current date and not a past date. 

 

 

 

"Report Name "+datetimeformat(DateTimeToday(),"%m-%d-%y")

3 REPLIES 3
DataNath
17 - Castor
17 - Castor

Hey @czjames87, if you're running this every Thursday then you'll just want to take away 5 days each time the workflow runs, using the DateTimeAdd() function:

 

"Report Name "+datetimeformat(
DateTimeAdd(datetimetoday(),-5,'day')
,"%m-%d-%y")
Clifford_Coon
11 - Bolide

Hi @czjames87  and @DataNath 

 

You can adjust for running on any day of the week by replacing the -3 with -(tonumber(DateTimeFormat(DateTimeToday(),"%w"))+1)

 

"Report Name "+datetimeformat(
DateTimeAdd(datetimetoday(),-(tonumber(DateTimeFormat(DateTimeToday(),"%w"))+1),'day'),"%m-%d-%y")

 

Annotation 2023-05-02 160824.jpg

czjames87
8 - Asteroid

that did it thank you! 

Labels
Top Solution Authors