9 Replies Latest reply on Mar 15, 2017 5:50 AM by Miikka Uosukainen

# Calculating Working Hours (excl weekends)

Hi.
I have been looking at the following posts trying to figure out how to calculate working hours (Mon-Fri 8am - 6pm) for individual support tickets of our Service desk.

and

It seems I have to somehow combine these suggestions into one. Or is there an easier way? I am no expert, so any assistance would be much appreciated.

Example Input Attached.

c.c

@. Indumon

@Dan Huff

• ###### 1. Re: Calculating Working Hours (excl weekends)

Good Morning Johann,

I have reviewed your data and see that only specific dates are provided against two countries.

I have 14 days in January, and 16 days in February when looking at the Ireland Data. Is this correctly representative data on that you would expect the working hours to be 140 hrs and 160 hours respectively?

Normal date comparisons assume the days are continuous from the start date to the end date and thus would not calculate the correct number of days when compared to your dataset.

Please let me know your expectations.

Many Thanks

Alastair

• ###### 2. Re: Calculating Working Hours (excl weekends)

Hi Johann,

Please find my approached to your problem.

Hope this works for you.

• ###### 3. Re: Calculating Working Hours (excl weekends)

Hi Alistair.

I am not sure what you are asking about countries etc.

See Example Data line 2

Ticket_Key      Created                 Resolved

ACIASD-9460 21/12/2016 10:15 03/01/2017 14:54

So I need to calculate (Resolved - Created) * 24

That gives me the consecutive hours.

But I need to find a way to exclude NON-working hours and weekends.

I hope that clarifies?

Thanks,

Johann

• ###### 4. Re: Calculating Working Hours (excl weekends)

Hi.

Your calculation is:

DATEDIFF('day',[Created],[Resolved])

and includes weekends and out of office hours - or am I missing something here?

What I am looking to do is to exclude Out Of Office hours.

J

• ###### 5. Re: Calculating Working Hours (excl weekends)

I hope this post helps.

And this is the reference of networkdays functions in tableau.

Thanks,

Shin

• ###### 6. Re: Calculating Working Hours (excl weekends)

I will have to play around a bit and see if I can figure it out.

Seems like a difficult one.

• ###### 7. Re: Calculating Working Hours (excl weekends)

Johann,

Yes, that 's not very easy.

If you still have trouble, I can try on your own file.

But if you can figure out by yourself, you gain the good knowledge/skills which will help you in the future

Best Regards,

Shin

1 of 1 people found this helpful
• ###### 8. Re: Calculating Working Hours (excl weekends)

Here is a similar request.

And better way to exclude weekends.

Thanks,

Shin

1 of 1 people found this helpful
• ###### 9. Re: Calculating Working Hours (excl weekends)

Hey,

I think this should solve your problem. The "workhour" calculation is kind of excessive, but it can be used to calculate also out of office hours tickets correctly (basically there are 9 different use cases as noted in calculated field comments).

Please let me know if this works as intended.