2020: Week 37
Challenge by: Jenny Martin
This week we're tackling some questions commonly asked by clients:
How do I calculate working days in Tableau Prep?
or
Is there a networkdays function in Tableau Prep?
Commonly, clients are looking to calculate the number of working days between the open and closing date of support tickets, to see if they're complying with their SLAs.
However, I thought we'd choose something a bit more fun for the challenge this week! Instead, let's work out how many days you've worked in a specific time period. This could be since you got your first "proper" job, since you started working for your current employer, days you've worked this year - anything you like!
Inputs
The inputs will need to be a little bespoke for this challenge. You will need:
- An input containing the date you'd like to start counting from
- An input containing information about the number of days holiday you took each year
- A bank holiday input for your country of residence. I've included a few countries below, but you may need to find your own data:
- A scaffolding input
Requirements
- Input the data
- Create a row for every date between your start date and today's date
- Filter out the weekends
- Perform any necessary cleaning on the bank holiday dataset
- Exclude bank holidays
- Count how many rows you have (being sure to exclude the start date)
- Remove any holiday days
- Output the data
Output
I decided to look into the number of days I've worked for The Information Lab! My start date was 1st April 2019, I've taken 26 days holiday in that time and I'm based in the UK. So this is my output, but I'm sure yours will look different.
- 3 fields
- Start Date
- Today
- Working Days
- 1 row (2 including headers)
There's no output file to compare against this week, as everyone will have something different!
After you finish the challenge make sure to fill in the participation tracker, then share your solution on Twitter using #PreppinData and tagging @Datajedininja, @JennyMartinDS14, @JonathanAllenby & @TomProwse1
You can also post your solution on the brand new Tableau Forum where we have a Preppin Data community page. Post your solutions and ask questions if you need any help!