I have data stored in a Vertica sql database structured like so:
location date count
Seattle 2015-09-21 48991
Portland 2015-09-21 38396
Seattle 2015-09-22 49639
Portland 2015-09-22 28817
Portland 2015-09-23 29183
Seattle 2015-09-23 50210
Portland 2015-09-24 29627
Seattle 2015-09-24 50844
Seattle 2015-09-25 56485
Portland 2015-09-25 30076
Portland 2015-09-26 30352
Seattle 2015-09-26 52011
Portland 2015-09-27 30491
Seattle 2015-09-27 52291
With count being a daily peak. I would like to pull the max count for each week, so I essentially end up with a weekly peak.
location week_ending_date count
Portland 2015-09-27 38396
Seattle 2015-09-27 56485
Any suggestions?
Thanks!