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 Early 2026. 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.

Function to output a week string?

bryanmac_92
8 - Asteroid

Hello,

 

I am trying to create a function where it will give you a week range date where if you run the function today it will give you the last 7 days as a range. ie. "3-22-23 to 3-29-23".

 

My best guess is: DateTimeAdd(DateTimeToday(),-7,"day") but not so sure.

 

Does anyone have any idea to replicate the range ("3-22-23 to 3-29-23") given if 3-29-23 is when the workflow is run?  

 

1 REPLY 1
Luke_C
17 - Castor
17 - Castor

Hi @bryanmac_92 

 

Your formula is correct - just a matter of formatting it:

 

More on datetime functions: DateTime Functions | Alteryx Help

 

DatetimeFormat(DateTimeAdd(DateTimeToday(),-7,"day"),'%m-%d-%Y') + ' to ' + DatetimeFormat(DateTimeToday(),'%m-%d-%Y')

 

Luke_C_0-1680138226796.png

 

 

Labels
Top Solution Authors