4 Replies Latest reply on Aug 1, 2016 4:11 AM by Stephane Marx

# need to remove weekends and holidays from a field "Month"

I want to calculate the number of days in a month by removing the weekends and holidays for a month.

• ###### 1. Re: need to remove weekends and holidays from a field "Month"

Hi Priya,

Please use the search function before posting a new question. This particular issue has come up a number of times and be solved in a number of ways - https://community.tableau.com/search.jspa?q=calculate+working+days

Please review those resources first and let us know if you have any specific questions regarding your scenario.

• ###### 2. Re: need to remove weekends and holidays from a field "Month"

I actually checked all those resources before I posted the question

My issue is Number of days per month say

January 31 - weekends - holidays=20 days

All need to be applied to one field Month.

• ###### 3. Re: need to remove weekends and holidays from a field "Month"

I struggle to believe you read through all of them! If you did, you would have found your answer!

Take a look at this FAQ - FAQ:  Holidays & Workdays

• ###### 4. Re: need to remove weekends and holidays from a field "Month"

When sorting weekdays (which is an option you have with dates data type) Tableau consider Sunday to be the first day and Saturday the last day of the week.

You can thus create a filter to exclude the value 1 and 7:

IF DATEPART('weekday',[Date])=1 or DATEPART('weekday',[Date])=7 then "HIDE"

ELSE "SHOW" END

Place that into the filter shelf and select "show"

The result will hide all Saturday and Sundays in your data set.

For more elements about dates, have a look at Tom's links, a lot of useful content listed and available

Hope this helps!