Hi team! Need some help here. I wanted to select Top N locations based on sum(value) desc and also latest calendar_date - 1 selected by the user. For example
If I select 8/7-8/17 & if today is 8/17 it would sort based off 8/16
If I select 8/7-8/20 & if today is 8/17 it would sort based off 8/16
If i select 8/1-8/5, & if today is 8/17 it should sort based off 8/5 (not 8/4)
Currently, its sorting based on sum(value) desc and whatever calendar_dates are displayed. For example, from the pic, its sorting based on sum(value) desc from 8/8 through 8/12 .