2022: Week 2 The Prep School - Birthday Cakes
Created by: Carl Allchin
Welcome back for week two. The first four challenges this year are aimed at people getting used to the fundamental skills of data prep (or maybe using the challenges to learn a new tool / language).
Last week, we introduced you to The Prep School by having you help us create a nice data set with the contact details of the parents of our pupils. This week we are working on a very different problem that you might not find a piece of cake!
The Prep School loves any excuse to buy a cake to celebrate and what is better than celebrating one of our student's birthdays? This sounds easy until you realise we have 1,000 students and what do we do about those who's birthday are on a weekend day? We can't have them miss out.
Input
Requirements
- Input the data set
- Removing any unnecessary fields (parental fields) will make this challenge easier to see what is happening at each step
- Format the pupil's name in First Name Last Name format (ie Carl Allchin)
- Create the date for the pupil's birthday in calendar year 2022 (not academic year) (link)
- Work out what day of the week the pupil's birthday falls on (link)
- Remember if the birthday falls on a Saturday or Sunday, we need to change the weekday to Friday
- Work out what month the pupil's birthday falls within
- Count how many birthdays there are on each weekday in each month (link)
- Note: there is an issue with my output as I use the birthday month rather than the 2022 date of the birthday (thanks Rosario). Output updated 17/1/22 9:45 PM GMT)
- Output the data
Output
- Pupil's Name
- Date of birth
- This Year's Birthday
- Month
- Cake Needed On
- BDs per Weekday and Month