Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

How to add business days to the date field.

viswamtulasi
7 - Meteor

How to add business days to the date field.

 

I would like to add the business days to the date field.

Example

Sl.No.

Date

Business Days

NewDate with Business Days

1

13-May-19

10

24-May-19

2

13-May-19

15

31-May-19

3

13-May-19

20

07-Jun-19

4

13-May-19

25

14-Jun-19

5

13-May-19

30

21-Jun-19

 

Please help to find the NewDate based on adding the business days.

 

Thanks in advance.

10 REPLIES 10
danilang
19 - Altair
19 - Altair

Hi @viswamtulasi 

 

When you're dealing with business days, you need to take both weekends and holidays into account.

 

This workflow takes your input,  generates dates into the future and then removes both weekends and holidays from the resulting data set, returning the date that is X business days from the start  

 

WF.png

 

The output is as follows

 

Results.png

 

 

Edit the list of holidays to fit your local requirements

 

Dan

viswamtulasi
7 - Meteor

Thanks Dan on your quick response and it is working good. 

 

I've another scenario, i.e. to add 25 Business Days to the different dates and example as below - 

 

Sl.No.DateBusiness DaysNewDate
113-May-192514-Jun-19
220-May-192521-Jun-19
305-May-192507-Jun-19
401-May-192504-Jun-19
510-May-192513-Jun-19

 

NOTE: Sl.No. 3 marked with red color since 05-May-19 is Sunday and adding next 25 Business days to such dates.

 

Will you please help on the above to get the NewDate value based on adding 25 days to the given date.

 

Thanks in advance. 

danilang
19 - Altair
19 - Altair

Hi @viswamtulasi 

 

This new version will handle any number of start dates with different numbers of business days as well.  I had to add an Sort tool to the original

 

Dan

asmith314
8 - Asteroid

Nevermind for the statement below, I figured it out. It is a condition of the DateTimeAdd Function for increment

 

In your condition expression within the Generate Rows tool, could you help me understand what 50 represents

 

Dates <= DateTimeAdd([Date],50,"days")

Pradeep66
8 - Asteroid

it represents no of days to add.

Steph23
7 - Meteor

Hi. How would you adjust the "Generate Dates" node where you want the date to fall 3 business days prior to another date in the list? For example, if we have a meeting on Jan 18, 2023, but need to send the content 3 business days prior to the meeting, we'd want to send it on January 12, 2023 (to account for MLK + weekends). Thanks!!

Adrian_T
Alteryx Alumni (Retired)

I thought to share a great resource on DateTime Functions in Alteryx, which should serve as a great reference for most questions asked here: https://help.alteryx.com/20223/designer/datetime-functions

 

Steph23
7 - Meteor

Thanks, @Adrian_T !! This is a great page! However, I'm not able to find an answer to my question about regarding Generate Dates for dates prior to a date in the list. Maybe I'm missing it... Any ideas?

BRRLL99
11 - Bolide

@danilang 

 

Hi Danil,

 

is there any specific reason why in generate rows tool >> condition expression >> Dates <= DateTimeAdd([Date],50,"days")

50 days has been used.

 

In my scenario i need to add only 1 working day, can I use the same formula?

Labels