<?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 in DQL with lookup field in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/makeTimeseries-in-DQL-with-lookupField/m-p/294132#M3124</link>
    <description>&lt;P&gt;Yeah, you can drop the last (incomplete) bucket&amp;nbsp;using to:-1m, but in this case you need to use from too.&lt;BR /&gt;This is what I mean:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries {
  uptime = avg(com.dynatrace.extension.network_device.sysuptime),
  by: { `dt.entity.network:device` },
  interval: 1m,
  from: -60m,
  to: -1m
}
| fieldsAdd status = if(isNotNull(uptime[]), 0, else: 1)
| fieldsRename device = `dt.entity.network:device`
| lookup [
    fetch `dt.entity.network:device`
    | expand tags
  ], lookupField: id, sourceField: device
| filter isNotNull(lookup.id)
| fields timeframe, interval, status, device, lookup.tags&lt;/LI-CODE&gt;&lt;P&gt;thanks to that you will drop the trailing null bucket&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Feb 2026 11:08:03 GMT</pubDate>
    <dc:creator>t_pawlak</dc:creator>
    <dc:date>2026-02-04T11:08:03Z</dc:date>
    <item>
      <title>makeTimeseries in DQL with lookupField</title>
      <link>https://community.dynatrace.com/t5/DQL/makeTimeseries-in-DQL-with-lookupField/m-p/294113#M3121</link>
      <description>&lt;P&gt;How to create makeTimeseries&amp;nbsp; in this DQL to be able to create alert from it :&lt;/P&gt;
&lt;P&gt;timeseries { uptime = avg(com.dynatrace.extension.network_device.sysuptime), by: { `dt.entity.network:device` }, interval:1m }&lt;BR /&gt;| fieldsAdd status = if(isNotNull(uptime[-5]), 0, else: 1)| fieldsRename device=`dt.entity.network:device`&lt;BR /&gt;| lookup [&lt;BR /&gt;fetch `dt.entity.network:device`&lt;BR /&gt;| expand tags&lt;BR /&gt;], lookupField:id, sourceField:device&lt;BR /&gt;| filter isNotNull(lookup.id)&lt;BR /&gt;| fields timeframe, interval, status, device, lookup.tags&lt;/P&gt;</description>
      <pubDate>Wed, 11 Feb 2026 06:34:09 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/makeTimeseries-in-DQL-with-lookupField/m-p/294113#M3121</guid>
      <dc:creator>scholcia</dc:creator>
      <dc:date>2026-02-11T06:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Maketimeseries in DQL with lookup field</title>
      <link>https://community.dynatrace.com/t5/DQL/makeTimeseries-in-DQL-with-lookupField/m-p/294119#M3122</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;To create a DQL-based custom alert, the query must output a numeric timeseries column array.&amp;nbsp;&lt;BR /&gt;I think that in your case&amp;nbsp;status is currently computed not as a array&amp;nbsp;because you use uptime[-5].&lt;BR /&gt;Try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries {
  uptime = avg(com.dynatrace.extension.network_device.sysuptime),
  by: { `dt.entity.network:device` },
  interval: 1m
}
| fieldsAdd status = if(isNotNull(uptime[]), 0, else: 1)
| fieldsRename device = `dt.entity.network:device`
| lookup [
    fetch `dt.entity.network:device`
    | expand tags
  ], lookupField: id, sourceField: device
| filter isNotNull(lookup.id)
| fields timeframe, interval, status, device, lookup.tags&lt;/LI-CODE&gt;&lt;P&gt;status as a 0/1 timeseries.&lt;BR /&gt;Then in alert select status&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2026 10:16:55 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/makeTimeseries-in-DQL-with-lookupField/m-p/294119#M3122</guid>
      <dc:creator>t_pawlak</dc:creator>
      <dc:date>2026-02-04T10:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Maketimeseries in DQL with lookup field</title>
      <link>https://community.dynatrace.com/t5/DQL/makeTimeseries-in-DQL-with-lookupField/m-p/294120#M3123</link>
      <description>&lt;P&gt;Thanks a lot it works however I need to exclude last value from array 'uptime' because in each case is "null" so that my alert will be useless.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2026 10:36:41 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/makeTimeseries-in-DQL-with-lookupField/m-p/294120#M3123</guid>
      <dc:creator>scholcia</dc:creator>
      <dc:date>2026-02-04T10:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: Maketimeseries in DQL with lookup field</title>
      <link>https://community.dynatrace.com/t5/DQL/makeTimeseries-in-DQL-with-lookupField/m-p/294132#M3124</link>
      <description>&lt;P&gt;Yeah, you can drop the last (incomplete) bucket&amp;nbsp;using to:-1m, but in this case you need to use from too.&lt;BR /&gt;This is what I mean:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries {
  uptime = avg(com.dynatrace.extension.network_device.sysuptime),
  by: { `dt.entity.network:device` },
  interval: 1m,
  from: -60m,
  to: -1m
}
| fieldsAdd status = if(isNotNull(uptime[]), 0, else: 1)
| fieldsRename device = `dt.entity.network:device`
| lookup [
    fetch `dt.entity.network:device`
    | expand tags
  ], lookupField: id, sourceField: device
| filter isNotNull(lookup.id)
| fields timeframe, interval, status, device, lookup.tags&lt;/LI-CODE&gt;&lt;P&gt;thanks to that you will drop the trailing null bucket&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2026 11:08:03 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/makeTimeseries-in-DQL-with-lookupField/m-p/294132#M3124</guid>
      <dc:creator>t_pawlak</dc:creator>
      <dc:date>2026-02-04T11:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Maketimeseries in DQL with lookup field</title>
      <link>https://community.dynatrace.com/t5/DQL/makeTimeseries-in-DQL-with-lookupField/m-p/294133#M3125</link>
      <description>&lt;P&gt;In documentation I found that you can use&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;arrayLast(uptime)&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;- it returns the last non-null element&lt;BR /&gt;&lt;A href="https://docs.dynatrace.com/docs/platform/grail/dynatrace-query-language/functions/array-functions" target="_self"&gt;Array functions&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2026 11:09:30 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/makeTimeseries-in-DQL-with-lookupField/m-p/294133#M3125</guid>
      <dc:creator>t_pawlak</dc:creator>
      <dc:date>2026-02-04T11:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Maketimeseries in DQL with lookup field</title>
      <link>https://community.dynatrace.com/t5/DQL/makeTimeseries-in-DQL-with-lookupField/m-p/294134#M3126</link>
      <description>&lt;P&gt;thanks, that's perfect solution !&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2026 11:18:21 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/makeTimeseries-in-DQL-with-lookupField/m-p/294134#M3126</guid>
      <dc:creator>scholcia</dc:creator>
      <dc:date>2026-02-04T11:18:21Z</dc:date>
    </item>
  </channel>
</rss>

