Alteryx Designer Desktop Discussions

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

Date Time Expression to Return Specific Weekday

CBotelho13
5 - Atom

Hello everyone! This is my first community post!

 

I am creating a new column in Designer where I want to return a specific day of the week. What I want is to create an expression which will return the Tuesday prior to the date in another column. I started with an IF/THEN conditional statement but am kind of stuck now. The column I am building off of is the [Annual Refresh Date] but only if my [Driver] is "Annual Refresh Date". This is what I have so far:

 

If [Driver]="Annual Refresh"

THEN (this is where I need a formula for the Tuesday prior to the [Annual Refresh Date])

ELSE "N/A" ENDIF

8 REPLIES 8
atcodedog05
22 - Nova
22 - Nova

Hi @CBotelho13 

 

What if it's Tuesday whats the logic then?

atcodedog05
22 - Nova
22 - Nova

Hi @CBotelho13 

 

Here is how you can do it. I am considering if its Tuesday then same day is taken.

Workflow:

atcodedog05_0-1642096926107.png

 

Hope this helps : )

 

atcodedog05
22 - Nova
22 - Nova

Hi @CBotelho13 

 

Here is a version even if it's Tuesday take the prior Tuesday.

 

Hope this helps : )

 

gabrielvilella
14 - Magnetar

Hi @CBotelho13, here is my take on this using a switch formula.

gabrielvilella_0-1642097589423.pnggabrielvilella_1-1642097606163.png

 

 

atcodedog05
22 - Nova
22 - Nova

Interesting take @gabrielvilella 🙂👍

CBotelho13
5 - Atom

thank you!

atcodedog05
22 - Nova
22 - Nova

Hi @CBotelho13 

 

Try @gabrielvilella it's much more optimized and also you are allowed to mark more than posts as solutions

 

Happy to help : )

Cheers and have a nice day!

CBotelho13
5 - Atom

Thanks for the tip! I have changed it up and also accepted his as a solution.

Labels