community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Remove Weekends to find date difference between Two dates

Meteor

Hello Community,

 

Can you please let me know how to find the difference between two dates. Here I've to exclude weekends while finding the difference. Attached is the sample data, here I'm doing Pay_Date - Due_Date.

Alteryx Certified Partner

Hi @chhamanshu if you use this syntax DateTimeDiff([Pay_Date],[Due_Date],"days") in a formula tool gives you the differences in days.

 

 

Datetimediff.PNG

 

 

Meteor

The solution which you have shared it won't exclude the weekends Saturday and Sunday 

Highlighted
Alteryx
Alteryx

Hi @chhamanshu 

 

The attached workflow should solve your problem. Using a Generate Rows tool, you create each date inbetween your Pay and Due Date Values. You can then use the formula tool to assign weekday names, allowing you to Filter out Weekend Values.

 

You then use the Summarize Tool to get the counts for each of these fields and join to your original dataset.

 

It requires 2 different streams for when Due Date is past Pay Date and Vice Versa, when using the Generate Rows Tool.

 

Let me know if you have any questions!

Capture.PNG

Kind Regards

Will

Meteor

It's working. Thanks a lot.

Alteryx
Alteryx

Glad to hear @chhamanshu! Can you mark this as solved in that case, so that other users with similar problems are able to reference this

Labels