Is beast mode needed?

Hi Everyone,

I created a card that uses a date_time_start dimension along with a ticket count on a metric table. This card shows the number of tickets that have a scheduled dispatch showing date and time.

What we want to do is turn past tickets to red except for today's and we used the Last 7 days by hour but the date range.

Here is the table from Yesterday-1/28 and it shows tickets that have scheduled dates from the last 7 days but it also shows date-1/28 ( the screenshot was made yesterday and giving an example as we don't have any dispatches scheduled for today-1/29).

We want to have the dates- 1/22-1/26 turn red. Would this be a "Case, When, Then, End" SQL?

Any assistacne is greatly appreciated.

Tagged:

Best Answer

  • Data_Devon
    Data_Devon Contributor
    edited January 29 Answer ✓

    Hopefully the GOATs 🐐 can chime in, but here's what I'd do:

    Use this CASE WHEN (you were on the right track thinking of using the CASE WHEN) to flag a date as before today:

    CASE WHEN `Date_Time_Start` < CURDATE() THEN 'Older' ELSE 'Newer' END
    

    This will create a new column that can signify whether the date is for a past ticket or not.

    Next, you'll use Color Rules (see link below) to highlight the table row when the "Older/Newer" column is == Older

    Let us know if this gets you where you need to go,

    Color Rules for Table

    ✅Did this solve your problem? Accept it as a solution!

    ❤️Did you love this answer? Mark it as "Awesome"!

    👍Do you agree with this process? Click "Agree"!

Answers

  • Data_Devon
    Data_Devon Contributor
    edited January 29 Answer ✓

    Hopefully the GOATs 🐐 can chime in, but here's what I'd do:

    Use this CASE WHEN (you were on the right track thinking of using the CASE WHEN) to flag a date as before today:

    CASE WHEN `Date_Time_Start` < CURDATE() THEN 'Older' ELSE 'Newer' END
    

    This will create a new column that can signify whether the date is for a past ticket or not.

    Next, you'll use Color Rules (see link below) to highlight the table row when the "Older/Newer" column is == Older

    Let us know if this gets you where you need to go,

    Color Rules for Table

    ✅Did this solve your problem? Accept it as a solution!

    ❤️Did you love this answer? Mark it as "Awesome"!

    👍Do you agree with this process? Click "Agree"!

  • Abe
    Abe Member

    @Data_Devon Thank you for the assistance!

    This is exactly what we were looking for! Thank you and have a great day!