<?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 Re: makeTimeseries | DQL in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/makeTimeseries-DQL/m-p/260043#M1352</link>
    <description>&lt;P&gt;If you wanted to have timeseries subsequent months you cannot have it. Timeseries requires even intervals and different months have different length. But if you want chart metric with monthly aggregation it is not necessary to build timeseries at all. Here is simpler query showcasing use of &lt;EM&gt;&lt;STRONG&gt;summarize&lt;/STRONG&gt;&lt;/EM&gt; for such purpose (it also uses new functionality to rounding timestamps)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch dt.davis.problems, from:now() - 365d
| fieldsAdd Duration = resolved_problem_duration
| summarize MTTR = avg(toDouble(Duration))/60000000000, by:{timestamp@M}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1729526320973.png" style="width: 810px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/23913i9251B4B381B7FDFC/image-dimensions/810x477?v=v2" width="810" height="477" role="button" title="krzysztof_hoja_0-1729526320973.png" alt="krzysztof_hoja_0-1729526320973.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Without new rounding it would look like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch dt.davis.problems, from:now() - 365d
| fieldsAdd Duration = resolved_problem_duration

| fieldsAdd month = toLong(formatTimestamp(timestamp,format:"M"))
| fieldsAdd yaer = getYear(timestamp)
| fieldsAdd timestamp=timestamp(yaer, month, 1, 0, 0,0)

| summarize MTTR = avg(toDouble(Duration))/60000000000, by:{timestamp}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Oct 2024 16:03:29 GMT</pubDate>
    <dc:creator>krzysztof_hoja</dc:creator>
    <dc:date>2024-10-21T16:03:29Z</dc:date>
    <item>
      <title>makeTimeseries | DQL</title>
      <link>https://community.dynatrace.com/t5/DQL/makeTimeseries-DQL/m-p/259553#M1346</link>
      <description>&lt;P&gt;Guys, can you help me understand how to transform the data I have separated by month into timeseries? I'm trying to use makeTimeseries, but when I do this, the data no longer returns separated by month due to the time parameter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch events, from:now() - 720d
| filter event.kind == "DAVIS_PROBLEM"
| sort timestamp desc
| fieldsAdd Duration = resolved_problem_duration
| fieldsAdd Time = event.end
| fieldsAdd DayOfMonth = getDayOfMonth(timestamp)
| fieldsAdd DayOfWeek = getDayOfWeek(timestamp)
| fieldsAdd DayOfYear = getDayOfYear(timestamp)
| fieldsAdd Ano = getYear(timestamp)
| fieldsAdd `Mês` = if(DayOfYear &amp;gt;=1 and DayOfYear &amp;lt;=31,"Janeiro",
                  else:if(DayOfYear &amp;gt;=32 and DayOfYear &amp;lt;=59,"Fevereiro",
                  else:if(DayOfYear &amp;gt;=60 and DayOfYear &amp;lt;=90,"Março",
                  else:if(DayOfYear &amp;gt;=91 and DayOfYear &amp;lt;=120,"Abril",
                  else:if(DayOfYear &amp;gt;=121 and DayOfYear &amp;lt;=151,"Maio",
                  else:if(DayOfYear &amp;gt;=152 and DayOfYear &amp;lt;=181,"Junho",
                  else:if(DayOfYear &amp;gt;=182 and DayOfYear &amp;lt;=212,"Julho",
                  else:if(DayOfYear &amp;gt;=213 and DayOfYear &amp;lt;=243,"Agosto",
                  else:if(DayOfYear &amp;gt;=244 and DayOfYear &amp;lt;=273,"Setembro",                  
                  else:if(DayOfYear &amp;gt;=274 and DayOfYear &amp;lt;=304,"Outubro",
                  else:if(DayOfYear &amp;gt;=305 and DayOfYear &amp;lt;=334,"Novembro",
                  else:if(DayOfYear &amp;gt;=335 and DayOfYear &amp;lt;=365,"Dezembro"
                  ))))))))))))
| fieldsAdd MesOrder = if(DayOfYear &amp;gt;=1 and DayOfYear &amp;lt;=31,"01",
                  else:if(DayOfYear &amp;gt;=32 and DayOfYear &amp;lt;=59,"02",
                  else:if(DayOfYear &amp;gt;=60 and DayOfYear &amp;lt;=90,"03",
                  else:if(DayOfYear &amp;gt;=91 and DayOfYear &amp;lt;=120,"04",
                  else:if(DayOfYear &amp;gt;=121 and DayOfYear &amp;lt;=151,"05",
                  else:if(DayOfYear &amp;gt;=152 and DayOfYear &amp;lt;=181,"06",
                  else:if(DayOfYear &amp;gt;=182 and DayOfYear &amp;lt;=212,"07",
                  else:if(DayOfYear &amp;gt;=213 and DayOfYear &amp;lt;=243,"08",
                  else:if(DayOfYear &amp;gt;=244 and DayOfYear &amp;lt;=273,"09",                  
                  else:if(DayOfYear &amp;gt;=274 and DayOfYear &amp;lt;=304,"10",
                  else:if(DayOfYear &amp;gt;=305 and DayOfYear &amp;lt;=334,"11",
                  else:if(DayOfYear &amp;gt;=335 and DayOfYear &amp;lt;=365,"12"
                  ))))))))))))
| filter Ano == 2024
| filter `dt.davis.is_duplicate` == false
| filter not(matchesPhrase(event.name,"Memory usage close to limits"))
| filterOut contains(event.name,"")
| summarize MTTR = avg(toDouble(Duration))/60000000000, by:{Ano,`Mês`,MesOrder,Time}

| sort MesOrder asc
| makeTimeseries MTTR = avg(MTTR), time:{`Mês`},interval:(730h), by:{`Mês`}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 11:17:26 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/makeTimeseries-DQL/m-p/259553#M1346</guid>
      <dc:creator>RPbiaggio</dc:creator>
      <dc:date>2024-10-17T11:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: makeTimeseries | DQL</title>
      <link>https://community.dynatrace.com/t5/DQL/makeTimeseries-DQL/m-p/260043#M1352</link>
      <description>&lt;P&gt;If you wanted to have timeseries subsequent months you cannot have it. Timeseries requires even intervals and different months have different length. But if you want chart metric with monthly aggregation it is not necessary to build timeseries at all. Here is simpler query showcasing use of &lt;EM&gt;&lt;STRONG&gt;summarize&lt;/STRONG&gt;&lt;/EM&gt; for such purpose (it also uses new functionality to rounding timestamps)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch dt.davis.problems, from:now() - 365d
| fieldsAdd Duration = resolved_problem_duration
| summarize MTTR = avg(toDouble(Duration))/60000000000, by:{timestamp@M}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1729526320973.png" style="width: 810px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/23913i9251B4B381B7FDFC/image-dimensions/810x477?v=v2" width="810" height="477" role="button" title="krzysztof_hoja_0-1729526320973.png" alt="krzysztof_hoja_0-1729526320973.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Without new rounding it would look like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch dt.davis.problems, from:now() - 365d
| fieldsAdd Duration = resolved_problem_duration

| fieldsAdd month = toLong(formatTimestamp(timestamp,format:"M"))
| fieldsAdd yaer = getYear(timestamp)
| fieldsAdd timestamp=timestamp(yaer, month, 1, 0, 0,0)

| summarize MTTR = avg(toDouble(Duration))/60000000000, by:{timestamp}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 16:03:29 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/makeTimeseries-DQL/m-p/260043#M1352</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-10-21T16:03:29Z</dc:date>
    </item>
  </channel>
</rss>

