Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Formula for using today's date to find the date of the previous Friday

bassro
5 - Atom

I am using Alteryx Designer x64 Version 2024.2.1.14 and I need help with a formula.  I need to use today's date to find the date of the previous Friday.  I have this formula: DateTimeFormat(DateTimeAdd(DateTimeNow(), -1 * (DateTimeDayOfWeek(DateTimeNow()) + 2) % 7, 'days'), '%Y-%m-%d') but I'm getting an error message for the (DateTimeDayOfWeek) that says "Unknown Function".  I have also tried using 

DateTimeFormat(DateTimeAdd(DateTimeNow(), -1 * (DateTimeNow() - DateTimeAdd(DateTimeNow(), -1 * (DateTimeNow() % 7), 'days')), 'days'), '%Y-%m-%d')

but I get an error message at the % 7 saying "Unmatched("   Any suggestions? 

2 REPLIES 2
abacon
12 - Quasar
bassro
5 - Atom

The solution worked.  Thanks for your help. 

Labels
Top Solution Authors