1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Redshift

Connected

Exercise

Windowing to the max

The Idaho field staff has been reporting back sample data for a variety of measures in their water system monitoring system. They'd like you to compare the Alkalinity samples to the maximum for that year to help them analyze trends towards the maximum. The data is kinda messy and you'll have to explicitly convert any dates.

Instructions

100 XP
  • Explicitly convert the sample_date to a date aliased as date_sampled and order by it.
  • Use a window function to calculate the max Alkalinity reading, characteristic_measurementvalue, for the year.