Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

have to check if yesterday's date was weekend or weekday

Sshasnk
8 - Asteroid

So basically I have to check if yesterday's date was a weekend or not if it is the weekend I have to pick friday's date 

 

The format which I am following: YYYY-MM-DD

Example:

* if today's date is 2020-11-09 -> yesterday's date will be 2020-11-08 (which is sunday) exclude -> 2020-11-07 (saturday) exclude -> 2020-11-06 (Friday) <- this is my answer

 

* another scenario, if today's date is 2020-11-10 -> yesterday's date, will 2020-11-09 ( Monday) <- this is my answer

 

Let me know if there is any confusion

 

Thanks

4 REPLIES 4
Aaron_Harter
11 - Bolide

Hi @Sshasnk

 

Check out the DateTime and Conditional functions in the formula tool to help you identify the day of the week, and use that to roll the date back as desired:

1.1.PNG 

messi007
15 - Aurora
15 - Aurora

Hello @Sshasnk,

 

Below my answer:

 

messi007_3-1605016980551.png

 

 

Attached the workflow as well, please mark it as solved if it sole your problem 🙂

 

Regards,

 

echuong1
Alteryx Alumni (Retired)

Try this. The formula is calculating the day of the week in number. If it's 1 (monday) then it's subtracting 3 days to get to friday. If it's 2 (sunday) then it's subtracting 2 days to get to friday. Otherwise, it's subtracting 1 day.

 

You can swap the date field ([field1]) for datetimetoday().

 

echuong1_0-1605017687261.png

 

 

ArijitRoy
8 - Asteroid

If there is a holiday in between or on Friday then how it will work. How to add holidays

Labels