sort the data from sqlite and ensure only show recent week data