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

Yesterday Date but ignoring Sunday

tf05
7 - Meteor

I have a formula set up that indicates yesterdays data in the output. On a Sunday no data is recorded and therefore on Monday this returns no data. Is there a way I can put in an exception which on Monday ignores Sunday and returns Saturday as 'Yesterday'

 

Currently I have a formula creating a field with yesterdays date  DateTimeAdd(DateTimeToday(),-1,'day')

 

and then filtering if [Date] = [Yesterday Date] 

 

renditionDownload.png

 

 

2 REPLIES 2
atcodedog05
22 - Nova
22 - Nova

Hi @tf05 

 

Here is the formula for yesterday where Sunday is excluded.

 

IF DateTimeFormat(DateTimeToday(),"%w")="1" THEN 
DateTimeAdd(DateTimeToday(),-2,"days")
ELSE 
DateTimeAdd(DateTimeToday(),-1,"days")
ENDIF

 

Hope this helps : )

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @tf05 

Cheers and have a nice day!

Labels
Top Solution Authors