Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
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