Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.

Alteryx Designer Desktop Discussions

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

Remove weekends from date fields

Pinky
8 - Asteroid

Hi Team,

 

I have data like shown below. I have two date fields which date1 and date 2 and date difference field is date2 -date1 and it is in seconds. So what i want is i have to remove the weekends(Sat, Sun) when i subtract the date2 from date1 field. like for example

 

1/27/2021 16:262/1/2021 11:05412714

here the difference the dates are from 1/27 to 2/1. So i want to remove the weekends which is 1/30 and 1/31 which Sat &Sun when i subtract date2 and date1. Can any one help me on this issue? I appreciate your help in advance. Thanks!

 

Date1Date2Date Difference in Seconds
3/18/2020 2:173/20/2020 14:43217565
9/3/2020 14:519/14/2020 14:17948395
8/31/2020 16:428/31/2020 16:4234
10/15/2020 14:4310/20/2020 20:06451411
10/22/2020 17:0010/23/2020 11:2866536
9/25/2020 16:069/29/2020 19:15356941
9/29/2020 19:5510/9/2020 19:18861795
10/1/2020 15:5110/1/2020 16:081065
10/1/2020 21:1410/13/2020 21:571039357
10/2/2020 15:2610/14/2020 15:421037755
10/2/2020 15:4410/14/2020 15:531037331
10/2/2020 16:3410/2/2020 16:40331
10/5/2020 14:1310/15/2020 4:23828620
10/5/2020 14:3410/15/2020 4:26827526
10/5/2020 16:5510/15/2020 18:49870855
10/5/2020 17:4510/15/2020 19:07868897
10/5/2020 18:2210/15/2020 20:41872345
1/27/2021 16:262/1/2021 11:05412714
3 REPLIES 3
clmc9601
13 - Pulsar
13 - Pulsar

Hi @Pinky,

 

I built a workflow that will identify weekends and calculate the total number of seconds. You can add this workflow onto your previous workflow which calculates the difference in seconds. I hope it helps! 

 

Screen Shot 2021-02-17 at 4.00.09 PM.png

Pinky
8 - Asteroid

This works as expected. Thanks for your reply.

clmc9601
13 - Pulsar
13 - Pulsar

Hi @Pinky, if my above post resolved your question, could you please mark it as a solution? Having this post marked as solved improves the community search engine for others seeking solutions, and I would greatly appreciate it. Thanks! 

 

If it didn't resolve your question, I'm happy to keep working with you to find a solution!

Labels