Yesterday variable in panel title?

Hi everyone!
I need to set the variable “in the past 24 hours”, i.e. 20-10-2021 - 21-10-2021, but can set only "${__from:date:DD-MM-YYYY} and dont know how make “-1 day”.

-1 day and yesterday are not the same. -1 day is from now to 24 hours ago. Yesterday is from 26-10-2021 00:00 to 26-10-2021 23:59.

In the time picker, yesterday is: now-1d/d and a 1 day timeshift is now-1d

Not sure if you can use these expressions in a variable though - how are you using the variable?

I mean “Yesterday” - it’s a 06.12.2021 00:00 - 06.12.2021 23:59, for example. I want use this timerange in Title of my panel.

Finnaly, i’m done. I’ve create Query variable $yesterday (Postgres in my case):

select CONCAT(CURRENT_DATE - interval '1 day', '-', CURRENT_DATE - interval '1 sec');

and past them in header of the chart.

1 Like