<?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 Calculate Expiration Dates Using DQL for Accurate Tracking in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Calculate-Expiration-Dates-Using-DQL-for-Accurate-Tracking/m-p/289631#M2762</link>
    <description>&lt;P&gt;I want to have a DQL query to calculate expiry date for a creation date to be expired in 90 days. However, the date value is raw, e.g. 2025-02-10T20:45:00.000+0000.&lt;/P&gt;
&lt;P&gt;I tried using a simple calculation like&amp;nbsp;TokenExpiryDate = CreatedDate + duration(90, "d") but displays as null. If I use timestamp, e.g. timestampy(CreatedDate), it gives me error. Can someone please share what else is missing? Tried asking copilot but not too helpful.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Dec 2025 12:35:42 GMT</pubDate>
    <dc:creator>orchidee</dc:creator>
    <dc:date>2025-12-17T12:35:42Z</dc:date>
    <item>
      <title>Calculate Expiration Dates Using DQL for Accurate Tracking</title>
      <link>https://community.dynatrace.com/t5/DQL/Calculate-Expiration-Dates-Using-DQL-for-Accurate-Tracking/m-p/289631#M2762</link>
      <description>&lt;P&gt;I want to have a DQL query to calculate expiry date for a creation date to be expired in 90 days. However, the date value is raw, e.g. 2025-02-10T20:45:00.000+0000.&lt;/P&gt;
&lt;P&gt;I tried using a simple calculation like&amp;nbsp;TokenExpiryDate = CreatedDate + duration(90, "d") but displays as null. If I use timestamp, e.g. timestampy(CreatedDate), it gives me error. Can someone please share what else is missing? Tried asking copilot but not too helpful.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2025 12:35:42 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Calculate-Expiration-Dates-Using-DQL-for-Accurate-Tracking/m-p/289631#M2762</guid>
      <dc:creator>orchidee</dc:creator>
      <dc:date>2025-12-17T12:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate expiration date</title>
      <link>https://community.dynatrace.com/t5/DQL/Calculate-Expiration-Dates-Using-DQL-for-Accurate-Tracking/m-p/289672#M2763</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;In DQL you can’t use a field that you just created in the same fieldsAdd.&lt;BR /&gt;Your DQL&amp;nbsp;&lt;/P&gt;&lt;P&gt;will give: The field CreatedTs doesn't exist, because TokenExpiryDate can’t “see” CreatedTs yet.&lt;BR /&gt;Try this way:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data record(CreatedDate = "2025-02-10T20:45:00.000+0000")
| fieldsAdd CreatedTs = toTimestamp(CreatedDate)
| fieldsAdd TokenExpiryDate = CreatedTs + duration(90, "d")&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="t_pawlak_0-1763374959011.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/30918i62F24C8E6A7BB155/image-size/medium?v=v2&amp;amp;px=400" role="button" title="t_pawlak_0-1763374959011.png" alt="t_pawlak_0-1763374959011.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Use two fieldsAdd steps or compute it directly.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Nov 2025 10:25:19 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Calculate-Expiration-Dates-Using-DQL-for-Accurate-Tracking/m-p/289672#M2763</guid>
      <dc:creator>t_pawlak</dc:creator>
      <dc:date>2025-11-17T10:25:19Z</dc:date>
    </item>
  </channel>
</rss>

