<?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: Timeseries remark/question in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285512#M2561</link>
    <description>&lt;P&gt;To expand on the previous,&lt;/P&gt;&lt;P&gt;Made it super simple (on DEMO):&lt;/P&gt;&lt;P&gt;Returns a timeseries (as it should)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="henk_stobbe_1-1757160061014.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/29988i5D655EE12E406ADA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="henk_stobbe_1-1757160061014.png" alt="henk_stobbe_1-1757160061014.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Adding fields (or fieldsKeep) returns an array:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="henk_stobbe_2-1757160194501.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/29989iE843056CFB1FF868/image-size/medium?v=v2&amp;amp;px=400" role="button" title="henk_stobbe_2-1757160194501.png" alt="henk_stobbe_2-1757160194501.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;KR Henk&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 06 Sep 2025 12:04:06 GMT</pubDate>
    <dc:creator>henk_stobbe</dc:creator>
    <dc:date>2025-09-06T12:04:06Z</dc:date>
    <item>
      <title>Timeseries remark/question</title>
      <link>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285450#M2556</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;
&lt;P&gt;The best way to explain is to show below examples, with the remark that only the first one works and does exactly what I wished&amp;nbsp; for:&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;timeseries var1 = sum(.y.z, {var2 = sum(x.yz)}&lt;BR /&gt;| fieldsAdd var3 = (var1 [] / var2 [] * 100)&lt;BR /&gt;| fieldsRemove var1, var2&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;timeseries var1 = sum(.y.z, {var2 = sum(x.yz)} &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;| fieldsAdd var3 = (var1 [] / var2 [] * 100)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;| fields var3&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;timeseries var1 = sum(.y.z, {var2 = sum(x.yz)} &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;| fieldsAdd var3 [] = (var1 [] / var2 [] * 100)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;| fieldsRemove var1, var2&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;timeseries var1 = sum(.y.z, {var2 = sum(x.yz)} &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;| fieldsAdd var3 [] = (var1 [] / var2 [] * 100)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;| fields var3&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;So my question is simple why don't I need the extra&amp;nbsp; "[]" in the fields add, and why can't I&amp;nbsp; use the "fields 3"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Who can shed some light on this?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/19170"&gt;@marc_zantingh&lt;/a&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;KR Henk&lt;/P&gt;</description>
      <pubDate>Mon, 08 Sep 2025 06:31:33 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285450#M2556</guid>
      <dc:creator>henk_stobbe</dc:creator>
      <dc:date>2025-09-08T06:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Timeseries remark/question</title>
      <link>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285469#M2557</link>
      <description>&lt;P&gt;Hey Henk!&lt;/P&gt;&lt;P&gt;DQL documentation is a little all over the place at the moment, but I'll try to answer from what experience with it I've gathered so far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding the need for '[]':&lt;/P&gt;&lt;P&gt;If we don't use the [], we'd be referencing the timeseries as an object and not the values inside.&lt;/P&gt;&lt;P&gt;If we want to reference the timeseries values inside an expression, we need to use the array accessor []&lt;/P&gt;&lt;P&gt;However, when we are &lt;STRONG&gt;defining a new field with fieldsAdd&lt;/STRONG&gt;, DQL expects us to provide the expression directly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I &lt;EM&gt;think&lt;/EM&gt;&amp;nbsp;var3 [] = … is actually syntactically invalid because we'd be &lt;U&gt;trying to define a timeseries as if it were already materialized&lt;/U&gt;. DQL simply claims that ver3 doesn't exist.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, in essence, when we write &lt;EM&gt;"var3[] ="&lt;/EM&gt; we're actually writing&amp;nbsp;&lt;STRONG&gt;&lt;U&gt;"var3[] = &lt;EM&gt;the content of var3 is&lt;/EM&gt;"&lt;/U&gt;&amp;nbsp;&lt;/STRONG&gt;and not&amp;nbsp;"var[]3 = the&amp;nbsp; array var3 is". They look almost similar but they're not the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if we just write "var3[] =" then we're just asking DQL to write the contents inside of var3, to which DQL promptly replies "I have no idea what var3 is"&lt;/P&gt;&lt;P&gt;---------------&lt;/P&gt;&lt;P&gt;Regarding the "fields 3" issue,&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;timeseries var1 = sum(`metric2`), var2 = sum(`metric2`)
| fieldsAdd var3 = (var1 [] / var2 [] * 100)
| fields var3&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This seems to work for me, but I didn't quite understand your usage of 'sum':&amp;nbsp;&lt;EM&gt;sum(.y.z, {var2 = sum(x.yz)}&amp;nbsp;&lt;/EM&gt;so my test query is probably not suited for what you're trying to test.&lt;/P&gt;&lt;P&gt;Any chance you could clarify the question?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if any of this helps you, cheers &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2025 11:04:37 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285469#M2557</guid>
      <dc:creator>PedroSantos</dc:creator>
      <dc:date>2025-09-05T11:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Timeseries remark/question</title>
      <link>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285473#M2558</link>
      <description>&lt;P&gt;Hi Pedro,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Great answer thanks, I have checked the last one again:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;timeseries var1 = sum(a.b.c),filter {(type =="FLOWER") AND (color=="RED")}, {var2 = sum(a.b.c), filter {color=="GREEN}}&lt;BR /&gt;| fieldsAdd var3 = (var1 [] / var2 [] * 100)&lt;BR /&gt;| fields var3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(sorry I had to remove customer data (-;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DQL reply:&amp;nbsp;&lt;SPAN&gt;Query does not return a timeseries. Consider using the makeTimeseries command&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There is no issue removing fields, or not removing anything..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks Henk&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2025 12:17:32 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285473#M2558</guid>
      <dc:creator>henk_stobbe</dc:creator>
      <dc:date>2025-09-05T12:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Timeseries remark/question</title>
      <link>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285489#M2559</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/11427"&gt;@henk_stobbe&lt;/a&gt;&amp;nbsp;, so I tried to put your query on a Demo Live environment notebook to see if I could replicate the issue you're facing, but it's not a valid query.&lt;/P&gt;&lt;P&gt;Then I tried to adjust it to make it valid but maintain the query purpose, but didn't have much success either:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PedroSantos_0-1757089459646.png" style="width: 818px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/29979i6EF7B2121289DB2D/image-dimensions/818x278?v=v2" width="818" height="278" role="button" title="PedroSantos_0-1757089459646.png" alt="PedroSantos_0-1757089459646.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;(This is on demo live so the metrics are from there and there isn't any customer data here).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you getting that error on a notebook or on another app that uses DQL?&lt;/P&gt;&lt;P&gt;Is there any chance you can try to replicate your query on demo live with dummy data metrics (so without customer info) like I did to replicate your specific error and post it here?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2025 16:29:19 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285489#M2559</guid>
      <dc:creator>PedroSantos</dc:creator>
      <dc:date>2025-09-05T16:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Timeseries remark/question</title>
      <link>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285502#M2560</link>
      <description>&lt;P&gt;Hi Pedro,&lt;/P&gt;&lt;P&gt;Sure, and FYI that is a great idea in general to put error query's on demo env, and that share it on the community if you want to share your issue.&lt;/P&gt;&lt;P&gt;For this an extra "Kudo". This could even be a community guideline!&lt;/P&gt;&lt;P&gt;KR Henk&lt;/P&gt;</description>
      <pubDate>Sat, 06 Sep 2025 08:07:25 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285502#M2560</guid>
      <dc:creator>henk_stobbe</dc:creator>
      <dc:date>2025-09-06T08:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: Timeseries remark/question</title>
      <link>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285512#M2561</link>
      <description>&lt;P&gt;To expand on the previous,&lt;/P&gt;&lt;P&gt;Made it super simple (on DEMO):&lt;/P&gt;&lt;P&gt;Returns a timeseries (as it should)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="henk_stobbe_1-1757160061014.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/29988i5D655EE12E406ADA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="henk_stobbe_1-1757160061014.png" alt="henk_stobbe_1-1757160061014.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Adding fields (or fieldsKeep) returns an array:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="henk_stobbe_2-1757160194501.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/29989iE843056CFB1FF868/image-size/medium?v=v2&amp;amp;px=400" role="button" title="henk_stobbe_2-1757160194501.png" alt="henk_stobbe_2-1757160194501.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;KR Henk&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Sep 2025 12:04:06 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285512#M2561</guid>
      <dc:creator>henk_stobbe</dc:creator>
      <dc:date>2025-09-06T12:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Timeseries remark/question</title>
      <link>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285540#M2563</link>
      <description>&lt;P&gt;re: presence of []&lt;BR /&gt;Examples in documentation look lie this:&lt;BR /&gt;&lt;A href="https://docs.dynatrace.com/docs/discover-dynatrace/platform/grail/dynatrace-query-language/operators#iterative-expressions" target="_blank"&gt;https://docs.dynatrace.com/docs/discover-dynatrace/platform/grail/dynatrace-query-language/operators#iterative-expressions&lt;/A&gt;&amp;nbsp;, so no [] on left side. In fact left side is optional as name of new field can be derived from exression on the right.&lt;BR /&gt;&lt;BR /&gt;Additionally: you do not define explicity type of target field, it is always derived from expression on the right. Expressions you showed implicltly use &lt;EM&gt;&lt;STRONG&gt;iCollectArray&lt;/STRONG&gt;&lt;/EM&gt;, which by definition produces array so the type is vey well known.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;re: array vs timeseries.&amp;nbsp;&lt;/P&gt;&lt;P&gt;timeseries is a bit "virtual" term: arrays of numbers with timeframe (type) and interval (being of type duration). It is not even obligatory that they are named as &lt;EM&gt;&lt;STRONG&gt;timeseries&lt;/STRONG&gt;&lt;/EM&gt; command produces. Please check example below:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1757327696537.png" style="width: 722px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/29994i97D077EF7E2574F0/image-dimensions/722x130?v=v2" width="722" height="130" role="button" title="krzysztof_hoja_0-1757327696537.png" alt="krzysztof_hoja_0-1757327696537.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is is more defined by consumers like visualization tiles or anomaly detection, then DQL as a language itself.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Sep 2025 10:36:46 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285540#M2563</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2025-09-08T10:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Timeseries remark/question</title>
      <link>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285544#M2564</link>
      <description>&lt;P&gt;Hi Krzysztof,&lt;/P&gt;&lt;P&gt;Thanks for expanding and clarifying, so only what is left for me is that given a timeseries:&lt;/P&gt;&lt;P&gt;fields (and fieldskeep) return an array, and remove fields (or do nothing) return the timeseries,&lt;/P&gt;&lt;P&gt;This seems to me not very consistent?&lt;/P&gt;&lt;P&gt;KR Henk&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Sep 2025 11:16:28 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285544#M2564</guid>
      <dc:creator>henk_stobbe</dc:creator>
      <dc:date>2025-09-08T11:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: Timeseries remark/question</title>
      <link>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285567#M2565</link>
      <description>&lt;P&gt;when you use &lt;EM&gt;&lt;STRONG&gt;| fields&lt;/STRONG&gt;&lt;/EM&gt; commad, you are asking just to leave fields enumerated after, so effectively you are removing fields being &lt;EM&gt;&lt;STRONG&gt;timeframe&lt;/STRONG&gt;&lt;/EM&gt; and &lt;EM&gt;&lt;STRONG&gt;interval&lt;/STRONG&gt;&lt;/EM&gt;.&lt;BR /&gt;&lt;BR /&gt;when you used&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;| fieldsRemove var1, var2&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;you asked only to remove var and var2, so as a result&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;imeframe&lt;/STRONG&gt;&lt;/EM&gt; and &lt;EM&gt;&lt;STRONG&gt;interval&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;stayed.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Sep 2025 16:59:28 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285567#M2565</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2025-09-08T16:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: Timeseries remark/question</title>
      <link>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285568#M2566</link>
      <description>&lt;P&gt;Hello Krzysztof,&lt;/P&gt;&lt;P&gt;Took me another 10 minutes, and then "The penny dropped", the answer&amp;nbsp; was already in your previous reply (-;&lt;/P&gt;&lt;P&gt;Thank you again for clarifying!&lt;/P&gt;&lt;P&gt;KR Henk&lt;/P&gt;</description>
      <pubDate>Mon, 08 Sep 2025 17:48:26 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Timeseries-remark-question/m-p/285568#M2566</guid>
      <dc:creator>henk_stobbe</dc:creator>
      <dc:date>2025-09-08T17:48:26Z</dc:date>
    </item>
  </channel>
</rss>

