Upgrading Server to version 22.1? We’ve enabled the faster AMP engine by default. Read about how these system settings changes might affect you.

2022-05-24 Updates: Login: If you are facing issues with logging in, please try clearing all your cookies or trying another browser. We have a fix being deployed on the evening of 5/25. Email: If you're not seeing emails be delivered from the Community, please check your spam and mark the Community emails as not junk. Thank you for your patience.

Alteryx Designer Discussions

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

Replicating Excel WORKDAY Function in Alteryx - feel free to use it if useful

IPWE
5 - Atom

So I'm quite new in Alteryx and been moving reports from manual tools (access/Excel) to Alteryx. 

 

Just realized that there is no function in Alteryx to easily calculate x amount of working days from a starting date (e.g. 28th Oct 2016 + 2 days = 1st of October 2016) so decided to write my own one (unless there is one in that case I wasted an hour of my time for this).

 

Then I found out that I can’t do while loops (Like I said, new in Alteryx), so I managed to do one without a while loop, 

 

The basic of the formula is this:

 

Start Date + (Floor( ((Daysof Week+DaysToAdd)-1/5)*2) + DaysToAdd = end date

 

If the Start Date is Sat/Sun then start from previous Friday.

 

Feel free to use it if you guys think it is useful.

12 REPLIES 12
KeithH
6 - Meteoroid

Hello! Holidays are not mandatory. I believe the issue is you are not including a field which specifies the number of days you would like to add to the start date. So in your data source, one column should be the start date, and another column should be days to add. For example, I take ORDER DATES and add LEAD TIME in business days to arrive at an EXPECTED DELIVERY DATE. 

 

This input:

KeithH_1-1642530866086.png

 

With this configuration:

KeithH_2-1642530896966.png

 

Results in this output:

KeithH_0-1642530836627.png

 

KeithH
6 - Meteoroid

Mond, looking at it again, I think I may know the issue. My workflow can only count forward, if you are trying to count backward (i,e., entering a negative value for "days"), it will not work. I haven't tried to modify it to count backwards because that has not been necessary for me. 

Mond
6 - Meteoroid

i was only really affected by the weekend so i just implemented a formula to check if the day is a monday or not and if so adjust the date to be the prior friday. it worked for my use case.

Labels