1. Learn
  2. /
  3. Courses
  4. /
  5. Window Functions in Snowflake

Connected

Exercise

Maintaining charger efficiency

As vehicle chargers age, their efficiency often wanes. The operations team is interested in performing proactive maintenance and identifying when a charger may need to be replaced. To do this, they'd like to have a report that tracks the change in charging rate in the last three charges. Let's see if you can give them a hand!

Instructions

100 XP
  • Use a window function to find the difference between the charging_rate for the current session and the charging_rate from 3 sessions ago.
  • Partition the result set data by the charging_station_location to make sure that results are isolated to each charging station.
  • Determine the sequence of sessions using the charging_start_time, in ascending order.
Powered by Snowflake