<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Shift Time Frame In a Dashboard Using a Input Variable in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Shift-Time-Frame-In-a-Dashboard-Using-a-Input-Variable/m-p/303822#M3467</link>
    <description>&lt;P&gt;I'm building a comparative transaction dashboard that should display day for the current time frame but also data shifted by a number of days that will be a variable input.&lt;/P&gt;&lt;P&gt;The goal is to be able to show current data versus a comparison with what the numbers look like "N" days ago and then calculate the variance.&lt;BR /&gt;&lt;BR /&gt;The structure of the table I am trying to create would look like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="victor_correa_0-1787769992549.png"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/34135i4647390553EEDA12/image-size/medium?v=v2&amp;amp;px=400" alt="victor_correa_0-1787769992549.png" title="victor_correa_0-1787769992549.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have been able to create something close to what I need using the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch bizevents,from: now()@d - (toLong($TxCountNDaysAgo) * 1d), to:now()@d - ((toLong($TxCountNDaysAgo)-1) * 1d)&lt;/LI-CODE&gt;&lt;P&gt;But if I select a time frame with a specific start time and end time, the shifted data will show the data for the full day, rather than just shifted by the number of days I have chosen.&lt;/P&gt;&lt;P&gt;I have tried shifting time using Unix Time, but then I can't set the parameter "from" and "to" with the values I generated:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch bizevents 
| fieldsAdd currentTimeStampUnix = unixSecondsFromTimestamp(timestamp) 
| fieldsAdd shiftedTimeStampUnix = unixSecondsFromTimestamp(timestamp) - 86400 
| fieldsAdd currentTimeStamp = timestampFromUnixSeconds(currentTimeStampUnix), shiftedTimeStamp = timestampFromUnixSeconds(shiftedTimeStampUnix)&lt;/LI-CODE&gt;&lt;P&gt;I'm wondering if anyone has done something along those lines and can share their insights on how they accomplished it.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Wed, 26 Aug 2026 18:48:05 GMT</pubDate>
    <dc:creator>victor_correa</dc:creator>
    <dc:date>2026-08-26T18:48:05Z</dc:date>
    <item>
      <title>Shift Time Frame In a Dashboard Using a Input Variable</title>
      <link>https://community.dynatrace.com/t5/DQL/Shift-Time-Frame-In-a-Dashboard-Using-a-Input-Variable/m-p/303822#M3467</link>
      <description>&lt;P&gt;I'm building a comparative transaction dashboard that should display day for the current time frame but also data shifted by a number of days that will be a variable input.&lt;/P&gt;&lt;P&gt;The goal is to be able to show current data versus a comparison with what the numbers look like "N" days ago and then calculate the variance.&lt;BR /&gt;&lt;BR /&gt;The structure of the table I am trying to create would look like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="victor_correa_0-1787769992549.png"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/34135i4647390553EEDA12/image-size/medium?v=v2&amp;amp;px=400" alt="victor_correa_0-1787769992549.png" title="victor_correa_0-1787769992549.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have been able to create something close to what I need using the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch bizevents,from: now()@d - (toLong($TxCountNDaysAgo) * 1d), to:now()@d - ((toLong($TxCountNDaysAgo)-1) * 1d)&lt;/LI-CODE&gt;&lt;P&gt;But if I select a time frame with a specific start time and end time, the shifted data will show the data for the full day, rather than just shifted by the number of days I have chosen.&lt;/P&gt;&lt;P&gt;I have tried shifting time using Unix Time, but then I can't set the parameter "from" and "to" with the values I generated:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch bizevents 
| fieldsAdd currentTimeStampUnix = unixSecondsFromTimestamp(timestamp) 
| fieldsAdd shiftedTimeStampUnix = unixSecondsFromTimestamp(timestamp) - 86400 
| fieldsAdd currentTimeStamp = timestampFromUnixSeconds(currentTimeStampUnix), shiftedTimeStamp = timestampFromUnixSeconds(shiftedTimeStampUnix)&lt;/LI-CODE&gt;&lt;P&gt;I'm wondering if anyone has done something along those lines and can share their insights on how they accomplished it.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2026 18:48:05 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Shift-Time-Frame-In-a-Dashboard-Using-a-Input-Variable/m-p/303822#M3467</guid>
      <dc:creator>victor_correa</dc:creator>
      <dc:date>2026-08-26T18:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Shift Time Frame In a Dashboard Using a Input Variable</title>
      <link>https://community.dynatrace.com/t5/DQL/Shift-Time-Frame-In-a-Dashboard-Using-a-Input-Variable/m-p/303828#M3468</link>
      <description>&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt;&lt;/U&gt;&lt;U&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/U&gt;I have managed to do the time shifts statically by using Unix Time and the Internal Variables "dt_timeframe_to" and "dt_timeframe_from":&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch bizevents,
   from: timestampFromUnixSeconds(unixSecondsFromTimestamp($dt_timeframe_from) - 86400), 
   to: timestampFromUnixSeconds(unixSecondsFromTimestamp($dt_timeframe_to) - 86400)&lt;/LI-CODE&gt;&lt;P&gt;But Dynatrace won't let me use variables in the "from" and "to" parameters, so I have to define the shift explicitly with numbers, which defeats the purpose of what I'm trying to do.&lt;BR /&gt;&lt;BR /&gt;Dynatrace won't let me change the values of the interval variables either, as that would solve my problem.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2026 20:03:04 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Shift-Time-Frame-In-a-Dashboard-Using-a-Input-Variable/m-p/303828#M3468</guid>
      <dc:creator>victor_correa</dc:creator>
      <dc:date>2026-08-26T20:03:04Z</dc:date>
    </item>
  </channel>
</rss>

