2021: Week 30 - Lift Your Spirits

 Challenge By: Jenny Martin

Inspiration for Preppin' challenges can come from anywhere. I've recently moved into a block of flats and let me tell you, I spend a lot of time waiting for a lift (or elevator if you're across the pond). It got me pondering whether the lift is operating optimally. Is it better to stay on the floor that you drop passengers until the next time someone calls a lift, or should the lift return to the most common starting floor?

Input

There is one input this week, detailing the time of each trip the lift takes, including which floor the passengers enter the lift and which floor the passengers leave the lift. 


For simplicity, assume that the lift does not stop mid-journey to pick up new passengers, but completes its current trip before starting a new one.

Requirements

  • Input the data
  • Create a TripID field based on the time of day
    • Assume all trips took place on 12th July 2021
  • Calculate how many floors the lift has to travel between trips
    • The order of floors is B, G, 1, 2, 3, etc.
  • Calculate which floor the majority of trips begin at - call this the Default Position
  • If every trip began from the same floor, how many floors would the lift need to travel to begin each journey?
    • e.g. if the default position of the lift were floor 2 and the trip was starting from the 4th floor, this would be 2 floors that the lift would need to travel
  • How does the average floors travelled between trips compare to the average travel from the default position?
  • Output the data

Output



  • 4 fields
    • Default Position
    • Avg travel from default position
    • Avg travel between trips currently
    • Difference
  • 1 row (2 rows including headers)
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

2024: Week 1 - Prep Air's Flow Card

2023: Week 1 The Data Source Bank

How to...Handle Free Text