Alteryx designer Discussions

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

Calculating a date difference for working days, ignoring weekends

Highlighted
6 - Meteoroid

Hi All,

 

I am trying to calculate the date difference between two "received dates". Point A receives an item after which it delivers it to point B. I am interested in finding the date difference between these two received dates, but I am only interested in working days, i.e. I want to ignore Saturdays and Sundays. If point A receives an item on friday 2018-03-09 and point B receives that item on Tuesday 2018-03-13 the date difference in terms of working days should be 2. But, my current workflow calculates the datediff as 4 days because it counts the weekend days. Does anyone know a clever way to calculate this just for work days?


Thanks!

 

New to alteryx but enjoying it so far!

Highlighted
Alteryx Certified Partner

Hey @Oliver

 

There is a macro on the gallery that does this: https://gallery.alteryx.com/#!app/Count-Weekdays/5862c055a18e9e0ff8d854cd

 

This would probably be a good starting point :)

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Hadn't seen that before, I've also built a verison: https://gallery.alteryx.com/#!app/Working-Day-Time-Difference/5a0ad875f499c708d037257

 

This works in a similar manner but not only can you specify holiday periods you can also select the working days specific to your business, and if you have a time field you can also specify opening hours so the clock stops  'out of hours'.

 

Ben

Labels