# is it possible to show yesterday or previous data/logs but at the same time duranion should be pick from dashboad timeframe?

**URL:** <https://community.dynatrace.com/t/is-it-possible-to-show-yesterday-or-previous-data-logs-but-at-the-same-time-duranion-should-be-pick-from-dashboad-timeframe/50122>\
**Category:** DQL\
**Tags:** dql, logs\
**Created:** [February 6, 2025, 8:58am UTC](https://community.dynatrace.com/t/is-it-possible-to-show-yesterday-or-previous-data-logs-but-at-the-same-time-duranion-should-be-pick-from-dashboad-timeframe/50122 "2025-02-06T08:58:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tarunbt](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@Tarunbt](https://community.dynatrace.com/u/Tarunbt)\
**Post date:** [February 6, 2025, 8:58am UTC](https://community.dynatrace.com/t/is-it-possible-to-show-yesterday-or-previous-data-logs-but-at-the-same-time-duranion-should-be-pick-from-dashboad-timeframe/50122/1 "2025-02-06T08:58:13Z")

</div>

I want to create tile with day -1 or previous date but at the same time I want to use common dashboard timeframe.

Mean if I set 4 hours in dashboard time duration tile show yesterday’s 4 hours data so that I can compare with today’s data.

---

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [February 6, 2025, 9:35am UTC](https://community.dynatrace.com/t/is-it-possible-to-show-yesterday-or-previous-data-logs-but-at-the-same-time-duranion-should-be-pick-from-dashboad-timeframe/50122/2 "2025-02-06T09:35:37Z")

</div>

There are 2 ways to approach it:

Yes, it is possible using special build-in variables:&nbsp;$dt\_timeframe\_from and $dt\_timeframe\_to.  
Use can use them explicitly in query to specify interesting time range as well as include them in expression which results in different time range as original.

In the query below I am going for timeframe 24h earlier then this specified in dashboard controls:

```markup
fetch logs, from:toTimestamp($dt_timeframe_from)-24h, 
to: toTimestamp($dt_timeframe_to)-24h
| summarize m1=min(timestamp), m2=max(timestamp)

```

Here is how result looks like. Left tile show results of same query without any time modification, so for last 30 minutes.

 ![krzysztof_hoja_0-1738833808175.png](https://global.discourse-cdn.com/dynatrace/original/2X/4/464112519ab1215e842d43711fbf3a19d82ad988.png)

When dealing with timeseries you can also use shift: parameter, to go for time range different then specified, but in relation to it. Query below will contain 2 timeseries: current one and this from previous day, but “mapped” into current time, so results will be synchronized on chart:

```markup
timeseries cpu=avg(dt.host.cpu.usage)
| append [
timeseries cpu=avg(dt.host.cpu.usage), shift: -24h
]

```

Result looks like this:

 ![krzysztof_hoja_1-1738834431784.png](https://global.discourse-cdn.com/dynatrace/original/2X/8/84bbf1c5372870224a27447199bdca47804b3e87.png)

Please select X-axis-\>Displayed timeframe-\>Data to adjust x-axis to basic timeframe.

---

<div class="post-metadata">

**Author:** ![Tarunbt](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@Tarunbt](https://community.dynatrace.com/u/Tarunbt)\
**Post date:** [February 6, 2025, 9:58am UTC](https://community.dynatrace.com/t/is-it-possible-to-show-yesterday-or-previous-data-logs-but-at-the-same-time-duranion-should-be-pick-from-dashboad-timeframe/50122/3 "2025-02-06T09:58:20Z")

</div>

Thanks, It is working as expected.

---

<div class="post-metadata">

**Author:** ![Tarunbt](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@Tarunbt](https://community.dynatrace.com/u/Tarunbt)\
**Post date:** [February 6, 2025, 10:08am UTC](https://community.dynatrace.com/t/is-it-possible-to-show-yesterday-or-previous-data-logs-but-at-the-same-time-duranion-should-be-pick-from-dashboad-timeframe/50122/4 "2025-02-06T10:08:23Z")

</div>

Could you please share Document page to explore it ?
