Alteryx Designer Desktop Discussions

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

Datetimediff using only weekdays/business days

JessicaAddy
5 - Atom

Is there a way to calculate the number of weekdays/business days between two dates?  I have spent some time searching the internet and the Alteryx Community, but cannot find any solutions to this.

 

Thanks!

Jessica

21 REPLIES 21
Mitchell_G
7 - Meteor

Thank you for your help! I am still having trouble with this. Here are some example records. I want to mimic column E calculating the net working days between for each record just like Excel does. I don't care about Holidays.

 

How would I get that batch macro to run for each record?

RodL
Alteryx Alumni (Retired)

I made some changes to the macro that eliminates reference to holidays and will capture the other data from your records. The output from the macro is labeled "Count". You can rename with a Select tool.

Attached is a new package with the updated macro.

Mitchell_G
7 - Meteor

Thank you Rod, this is very cool! I'll have to spend some time learning how to do this myself someday soon.

dh1926
5 - Atom

RodL,  I'm having trouble downloading the most recent module you attached.  I downloaded and can execute the first one without any trouble.  When I try to extract the last one, I get the error "This document was created by a more recent version of this application and cannot be read."  I've doublechecked that I have the most current version of Alteryx on my pc (ver 10.1.6.60263).  Any idea why I might be having this trouble?

Thank you!

p.s.  this thread is very helpful.

Mitchell_G
7 - Meteor

Strange symptoms. I also leveraged 's formula from earlier in the thread to make the macro as well. This is my first macro, let me know your thoughts!

dh1926
5 - Atom

MitchellG, When I click the download link on yours a page opens up with the .xml code but it doesn't give me the option to open in Alteryx or save as a file. Could be something with my firewall, I suppose.

Mitchell_G
7 - Meteor

I have the same problem in Internet Explorer, but not in Chrome. I'm not sure why.

dh1926
5 - Atom

Good to know!  I'll try a different browser - thanks!

ayx-droid
7 - Meteor

I would like to extend it further to check holidays on different states. I tried bringing in another Control Parameter in the macro which will identify a state. But I could not get this working. What would be the best approach?

brenda_watts
5 - Atom

Fantastic.  This is much simpler that anything I was trying.  Thanks for your help.

Labels