In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

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
14 - Magnetar

@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
14 - Magnetar

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

OllieClarke
16 - Nebula
16 - Nebula

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
Top Solution Authors