added possiblilty to specify a compared_to date (compared to prev day/week/month/year)