Alteryx Designer Desktop Discussions

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

Is There a Way to Check What the Day of the Week is?

shaheer
8 - Asteroid

I have a flow that I run every morning. It takes a file I downloaded, makes some changes that I used to make manually, and then saves over a file in another folder. 

 

I want to do this same thing, but only if the day of the week is Monday. It looks something like this:

 

shaheer_0-1674829268259.png

 

I do not want to save any days of the week or dates in this file either. Any help is appreciated. 

3 REPLIES 3
ShankerV
17 - Castor

Hi @shaheer 

 

Please use the below formula.

 

DateTimeFormat([Field1],"%A")

 

ShankerV_0-1674829705477.png

 

 

grazitti_sapna
17 - Castor

@shaheer , Please use the below expression in the below highlighted formula tool and then use filter tool to get the records of Monday. Let me know if it was useful

 

DateTimeFormat([Field1],"%A")

 

grazitti_sapna_0-1674830590281.png

Thanks,

Sapna Gupta
Christina_H
14 - Magnetar

You can use a filter tool instead of a formula tool to only allow records through on a Monday:

DateTimeFormat(DateTimeToday(),"%a")="Mon"

 

However, on other days the data file will be overwritten with blank data.  You could build a macro to deactivate the output tool unless it's Monday, but a simpler solution might be to redirect the data elsewhere on other days.  So in a formula tool, have something like this:

IF DateTimeFormat(DateTimeToday(),"%a")="Mon" THEN 'filepath on Monday' ELSE 'alternative filepath' ENDIF

Then have the output tool take the file path from this field.

Labels
Top Solution Authors