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.

how to pull age of a ticket excluding non working day and time

shahnawaz_khan
8 - Asteroid

 

Hi, 

 

How to calculate Working days & time below  between two dates in days & total time.

 

04-11-2024 12:27:44   14-11-2024 14:44:05

 

9:30am to 7pm - Working hours

7:00pm to 9:30am - Non Working hours

Sunday - No days

 

in attached sample you can use "Created On" & "Closed date time"

3 REPLIES 3
OTrieger
12 - Quasar

@shahnawaz_khan 

You can use this formula
DateTimeDiff(dt1,dt2,u)

U can be days, hours, minutes etc.

Do not forget to transform the data to be a datetime format, as this will not work with strig

OTrieger
12 - Quasar

From date you can get the days, and then deduct the weekends.

OllieClarke
15 - Aurora
15 - Aurora

Hey @shahnawaz_khan 

 

Working hours are a bit tricky. My approach is to generate every minute between the start and end times, and then filter out the non-working ones. 

You can then count the minutes, and divide by 60 to find the hours. This obviously explodes your data. You could generate the hours, but I wanted the fidelity of data to account for start and end times not lining up perfectly with the working hour boundaries.

image.png

 

Hope that helps,

 

Ollie

Labels