Free Trial

Alteryx Designer Desktop Discussions

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

How do I find the difference between two dates while excluding weekends and Holidays?

JasonDavis95
6 - Meteoroid

Essentially, I'm trying to replicate the NETWORKDAYS function from Excel. Below is an example of the two columns and expected results. For this example, the time frame is April - June, where 5/27/24 and 6/19/24 are both Holidays. I should also note that the RECEIPT_DT is technically day 0. 

 

RECEIPT_DTFD_DATEExpected Delta (Days)
4/3/244/3/240
5/17/245/20/241
5/1/245/3/242
5/24/245/29/242

 

My current approach has been adding an "input" to my Workflow followed by a "formula" and using ChatGPT to write the code. I'm able to get it working but can't seem to solve the Holiday part. For example, in the last row of my table, the result I keep getting is 4 days. 

 

Please let me know if I can provide any additional information. Thank you!

4 REPLIES 4
Garrett_Stoker
8 - Asteroid

Here is a solution from a few years ago, but it requires you to provide a list of holidays:

 

https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Calculate-difference-between-t...

JasonDavis95
6 - Meteoroid

That post is able to solve most of what I'm looking for except for scenarios such as the last row in my example table where a full weekend and holiday fall between the two dates. 

Garrett_Stoker
8 - Asteroid

Can you expand on why it wouldn't work? The solution given has a filter to get rid of all weekends, and a separate process that removes provided holidays. I'd think that would do the trick, unless I misunderstand.

JasonDavis95
6 - Meteoroid

Edited my reply. I fixed the issue and the link you provided was a huge help. Thank you so much. 

Labels
Top Solution Authors