Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Add business days to a date based on logic (Conditional if then else)

manjarigoyal1975
7 - Meteor

I need some help in adding the number of business days based on logic in Alteryx. I am not sure how to do it. I have thousands of rows with different values in the column Date and Type. If I use this logic below then it includes Saturdays and Sundays not sure how can I remove the weekends. 

 

LOGIC: if !IsEmpty([Date]) and ([Type] = "IXRE" or IsEmpty([Type])) then DateTimeAdd([Date],15,"days") elseif !IsEmpty([Date]) and [Type] != "IXRE" then DateTimeAdd([Date],10,"days") else Null() endif

 

Sample data

DateType
2021-05-24IXRE
2021-05-25SAS-MXP
2021-06-05 

 

Any help is appreciated.

 

Thanks

2 REPLIES 2
Luke_C
17 - Castor
17 - Castor
apathetichell
20 - Arcturus

if you throw in a filter with tonumber(datetimeformat([date],"u"))>=6 - you'll filter out saturdays and sundays.

Labels
Top Solution Authors