<?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 Create a 'timeseries-chart' of totals in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Create-a-timeseries-chart-of-totals/m-p/276916#M2050</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I'd like to create a 'timeseries-chart' of totals, for example total number of cars per type, per month. Using 'interval=30d' gives me a 'sliding window' of totals per 30 days, not per month and not starting the first of every month. I want to get an overview of totals for Januari, Februari, Match etc.&lt;/P&gt;
&lt;P&gt;Does anyone know how to do this?&lt;/P&gt;
&lt;P&gt;Regrads, Chiel&lt;/P&gt;</description>
    <pubDate>Mon, 12 May 2025 07:32:24 GMT</pubDate>
    <dc:creator>Chiel</dc:creator>
    <dc:date>2025-05-12T07:32:24Z</dc:date>
    <item>
      <title>Create a 'timeseries-chart' of totals</title>
      <link>https://community.dynatrace.com/t5/DQL/Create-a-timeseries-chart-of-totals/m-p/276916#M2050</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I'd like to create a 'timeseries-chart' of totals, for example total number of cars per type, per month. Using 'interval=30d' gives me a 'sliding window' of totals per 30 days, not per month and not starting the first of every month. I want to get an overview of totals for Januari, Februari, Match etc.&lt;/P&gt;
&lt;P&gt;Does anyone know how to do this?&lt;/P&gt;
&lt;P&gt;Regrads, Chiel&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 07:32:24 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Create-a-timeseries-chart-of-totals/m-p/276916#M2050</guid>
      <dc:creator>Chiel</dc:creator>
      <dc:date>2025-05-12T07:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create a 'timeseries-chart' of totals</title>
      <link>https://community.dynatrace.com/t5/DQL/Create-a-timeseries-chart-of-totals/m-p/276978#M2055</link>
      <description>&lt;P&gt;This is possible, but requires some steps. Suppose your starting point is timeseries data with interval=24h. In this case, you would use three additional steps:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Transform your timeseries data to generate a separate record for each day. You can start with &lt;A href="https://community.dynatrace.com/t5/DQL/Pro-Tip-DQL-Query-Snippets-Collection/m-p/270741/highlight/true#M1737" target="_self"&gt;this&lt;/A&gt; DQL snippet and adapt to your needs.&lt;/LI&gt;&lt;LI&gt;Use the &lt;A href="https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-query-language/functions/time-functions#getMonth" target="_self"&gt;getMonth&lt;/A&gt; function to extract the month of the year into a new field.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Use the &lt;A href="https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-query-language/commands/aggregation-commands#summarize" target="_self"&gt;summarize&lt;/A&gt; command to generate totals by month and use this data as the basis for your visualization.&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Mon, 12 May 2025 21:41:24 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Create-a-timeseries-chart-of-totals/m-p/276978#M2055</guid>
      <dc:creator>marco_irmer</dc:creator>
      <dc:date>2025-05-12T21:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create a 'timeseries-chart' of totals</title>
      <link>https://community.dynatrace.com/t5/DQL/Create-a-timeseries-chart-of-totals/m-p/277000#M2059</link>
      <description>&lt;P&gt;Hi Marco,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;As you describe it, it worked, but how do you visualize this?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;....&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;| fieldsAdd month = getMonth(timestamp)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| summarize countDistinct(serverName), by:{month,currentOSVersion}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;month&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;currentOSVersion&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;countDistinct(serverName)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;4&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;SPAN&gt;Microsoft Windows Server 2016 Stand&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;141&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;4&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;Microsoft Windows Server 2019 Standard&lt;/DIV&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;163&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;5&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;Microsoft Windows Server 2019 Standard&lt;/DIV&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;139&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;&lt;SPAN&gt;Microsoft Windows Server 2019 Stand&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;164&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;Microsoft Windows Server 2022 Standard&lt;/DIV&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;211&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Because there is no 'real' timestamp anymore in the output, it is not possible to make a bar chart or something like that.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; The &lt;STRONG&gt;maketimeseries&lt;/STRONG&gt; command would be the most obvious for my initial question, but then you cannot make totals per month.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 06:38:21 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Create-a-timeseries-chart-of-totals/m-p/277000#M2059</guid>
      <dc:creator>Chiel</dc:creator>
      <dc:date>2025-05-13T06:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create a 'timeseries-chart' of totals</title>
      <link>https://community.dynatrace.com/t5/DQL/Create-a-timeseries-chart-of-totals/m-p/277108#M2065</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;getMonth()&lt;/STRONG&gt;&lt;/EM&gt; gives you only month number, which will not be nicely cartable on x-axis where we want to see actual time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let's start with simpler example where the source is not a metric, but event/logs/etc. If we introduce grouping by timeframes defined as full months using&amp;nbsp;@ time alignment operator then bars will reflect full months:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch bizevents
| summarize count(), by: { event.provider, timeframe = timeframe(from: timestamp@M, to:timestamp@M+1M) }&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-1747168896378.png" style="width: 762px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/27980iD7ADEC69F5F4943A/image-dimensions/762x214?v=v2" width="762" height="214" role="button" title="krzysztof_hoja_0-1747168896378.png" alt="krzysztof_hoja_0-1747168896378.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the source is a metric, steps described by&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/19769"&gt;@marco_irmer&lt;/a&gt;&amp;nbsp;are correct, but I would use technique I described above.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries { req=sum(dt.service.request.count), timestamp=start() } , by:{http.response.status_code}
| fieldsAdd d=record(timestamp=timestamp[], req=req[])
| expand d
| summarize req=sum(d[req]), by: { http.response.status_code=toString(http.response.status_code), 
  timeframe = timeframe(from: d[timestamp]@M, to:d[timestamp]@M+1M) }&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_1-1747169435534.png" style="width: 773px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/27981i2E8CD22D40270040/image-dimensions/773x344?v=v2" width="773" height="344" role="button" title="krzysztof_hoja_1-1747169435534.png" alt="krzysztof_hoja_1-1747169435534.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;additionally by using &lt;EM&gt;&lt;STRONG&gt;start()&lt;/STRONG&gt;&lt;/EM&gt; function in &lt;EM&gt;&lt;STRONG&gt;timeseries&lt;/STRONG&gt;&lt;/EM&gt;, we immediately have timestamp of datapoint&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 20:52:09 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Create-a-timeseries-chart-of-totals/m-p/277108#M2065</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2025-05-13T20:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create a 'timeseries-chart' of totals</title>
      <link>https://community.dynatrace.com/t5/DQL/Create-a-timeseries-chart-of-totals/m-p/277140#M2071</link>
      <description>&lt;P&gt;This is what I was looking for. Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 07:20:55 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Create-a-timeseries-chart-of-totals/m-p/277140#M2071</guid>
      <dc:creator>Chiel</dc:creator>
      <dc:date>2025-05-14T07:20:55Z</dc:date>
    </item>
  </channel>
</rss>

