Alteryx Designer Desktop Discussions

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

Using the DateTimeDiff function but exclude weekends

jbooker1
5 - Atom

I am trying to count the numbers of days between two dates but want to exclude the weekend days from the count. For example from 7/30/21 to 8/5/21, I only want to have a value of 5 returned not 7.

3 REPLIES 3
JosephSerpis
17 - Castor
17 - Castor

Hi @jbooker1 I mocked up and approach on one way to tackle this. Essentially the approach generates all the days from the start and end days and then filters out Saturday and Sunday. I used some of the date time functions and specifiers from Alteryx which can be found here. One of the benefits of an approach like this is you can follow the entire process in a number of steps and should be able to easily troubleshoot any issues that might appear. 

 

Dates_08082021.JPG

jbooker1
5 - Atom

That did work, thank you for the insight. The one modification I did was I used the DateTime tool to convert the Date/Time fields to string on the source data at the beginning of the workflow that way I could select the new formatted columns as I built the rest of the work flow.

apathetichell
18 - Pollux

@jbooker1without having looked at @JosephSerpis  - check out how he uses the multi-field tool. That does the conversion and keeps the original file name but changes it to a date.

Labels