2024: Week 7 - Valentine's Day

Challenge by: Jenny Martin

We'll take a break from helping Prep Air for this challenge, but don't worry, it's for a good cause! We've got a number of couples who want some inspiration for Valentine's Day gifts (since this challenge is being released on Valentine's Day!) We want to count the number of Valentine's Days that the couples have been together for, so they can get inspired on how to theme their gifts this year.

Inputs

A list of the couples and when their relationships began.

Gift ideas based on the length of time they've been together (based on this website)

Requirements

  • Input the data
  • Fix the Relationship Start field so that it has a Date data type
  • Create a field for today's date (14/02/2024)
  • To count the number of Valentine's days, we need to think a little more creatively than using a simple datediff function to count the number of years. A couple of potential routes could be:
    • Scaffolding the data so there is a row per day, filtering to Valentine's days and counting the number of rows
    • A logical calculation that takes into consideration whether the Couple's Relationship Start date is before or after Valentines Day
  • To prepare to join onto the Gift ideas dataset, make the Year field match the data type of the Number of Valentine's field
  • Join the 2 datasets together
  • Remove unnecessary fields
  • Output the data

Output

  • 3 fields
    • Couple
    • Number of Valentine's Days as a Couple
    • Gift
  • 10 rows
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 & @TomProwse1

You can also post your solution on the Tableau Forum where we have a Preppin' Data community page. Post your solutions and ask questions if you need any help! 

Popular posts from this blog

2023: Week 1 The Data Source Bank

2023: Week 2 - International Bank Account Numbers

How to...Handle Free Text