Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Embedding to/from dates in formula (for subject line of email)

Empower49
8 - Asteroid

Hello experts! I have created a workflow and need to email the output with a subject line of "Great data from 1/4/19 to 2/28/19". The dates are the beginning and ending dates of one of the variables within my workflow. These dates will change every time I run the report.Today the dates will be 1/4/19 to 2/28/19, next week the dates will be 1/7/19 to 2/28/19, then 1/8/19 to 2/28/19, etc.

 

I created a new variable of "Report Subject" so I could use that as the field for the email subject line. I tried "Great data" and min([date]) "to" max([date]) as the expression with no luck because the date is not a numeric field, it is a datetime field. Does anyone have advice for how to build this expression?

 

Thank you!

2 REPLIES 2
JohnJPS
15 - Aurora

Hello @Empower49,

 

First, run the data through a Summarize tool to generate min and max date values

 

Then, create the variable and use the DateTimeFormat expression to generate the relevant strings within your formula... something like

"Great data from " + DateTimeFormat([minDate],"%m/%d/%y") + 
" to " + DateTimeFormat([maxDate],"%m/%d/%y")

Assuming your output from the Sumarize tool had [minDate] and [maxDate] for the calculated min/max dates.

Hope that helps!

Empower49
8 - Asteroid

Thank you so much John! This is perfect. I appreciate you sharing your expertise with a newbie!

Labels