Date filter

I have data that has reporting data for every day. I need help creating a quick filter on dashboard when i select it and see last 7 days

Tagged:

Best Answer

  • GrantSmith
    GrantSmith Coach
    Answer ✓
    CASE WHEN `Date` >= CURRENT_DATE() - INTERVAL 6 DAYS AND `Date` <= CURRENT_DATE() THEN 'YES' ELSE 'NO' END
    

    This will check if your date is within today and 6 days ago (Tuesday - Monday using today as an example) You can tweak it if you want to look at 1-7 days ago.

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**

Answers

  • GrantSmith
    GrantSmith Coach
    Answer ✓
    CASE WHEN `Date` >= CURRENT_DATE() - INTERVAL 6 DAYS AND `Date` <= CURRENT_DATE() THEN 'YES' ELSE 'NO' END
    

    This will check if your date is within today and 6 days ago (Tuesday - Monday using today as an example) You can tweak it if you want to look at 1-7 days ago.

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • Great thanks!