# Create an MTTD Tile in Dynatrace Dashboard Using DQL

**URL:** <https://community.dynatrace.com/t/create-an-mttd-tile-in-dynatrace-dashboard-using-dql/53565>\
**Category:** DQL\
**Tags:** dql, problem-detection, dynatrace-managed, problems, dpl\
**Created:** [September 30, 2025, 10:52am UTC](https://community.dynatrace.com/t/create-an-mttd-tile-in-dynatrace-dashboard-using-dql/53565 "2025-09-30T10:52:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarfarazx01a](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@sarfarazx01a](https://community.dynatrace.com/u/sarfarazx01a)\
**Post date:** [September 30, 2025, 10:52am UTC](https://community.dynatrace.com/t/create-an-mttd-tile-in-dynatrace-dashboard-using-dql/53565/1 "2025-09-30T10:52:17Z")

</div>

Hi All,

I’m working on a tile for Mean Time To Detect (MTTD) to detect the problem when it occurs first. I wrote a DQL query, but I think the query is not giving the correct results. Can anyone please assist me on this.

fetch events  
| filter event.kind == “DAVIS\_PROBLEM”  
| fieldsAdd time  
| fieldsAdd detection\_time = toDuration(timestamp - event.start)  
//| summarize mean\_detection\_time = avg(detection\_time)

---

<div class="post-metadata">

**Author:** ![p\_devulapalli](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/p_devulapalli/32/41590_2.png) [@p\_devulapalli](https://community.dynatrace.com/u/p_devulapalli)\
**Post date:** [October 2, 2025, 1:20am UTC](https://community.dynatrace.com/t/create-an-mttd-tile-in-dynatrace-dashboard-using-dql/53565/2 "2025-10-02T01:20:09Z")

</div>

[@sarfarazx01a](https://community.dynatrace.com/user/95764)&nbsp;Depending on your definition of MTTD you can use something like below to calculate MTTD for each of the problems .

```markup
fetch events
| filter event.status_transition == "CREATED" AND event.kind == "DAVIS_PROBLEM"
| fieldsAdd `PRB_MTTD` = timestamp - event.start

```

---

<div class="post-metadata">

**Author:** ![sarfarazx01a](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@sarfarazx01a](https://community.dynatrace.com/u/sarfarazx01a)\
**Post date:** [December 8, 2025, 2:27pm UTC](https://community.dynatrace.com/t/create-an-mttd-tile-in-dynatrace-dashboard-using-dql/53565/3 "2025-12-08T14:27:25Z")

</div>

Hi&nbsp;[@p\_devulapalli](https://community.dynatrace.com/user/21657)&nbsp;,

Thank you for the query, but the query doesn’t give the correct MTTD. In my environment, a problem detected at 19:30 and it gave a MTTD as 9.06 min but the problem started analysis at 19:27 so the MTTD would be 3 min, am i correct with the below scenario?  
Kindly suggest

19:27&nbsp;Analysis timeframe start. Davis evaluates performance across timeframe (for example, 3 of 5 minutes show anomalous performance). No event reported at this time.19:39&nbsp;Earliest event in analysis timeframe reported, backdated to analysis timeframe start. Problem is in processing state awaiting completion of topology analysis. Problem is raised and pushed to Dynatrace web UI and Problems API.19:39&nbsp;Davis completes processing of the problem. Alerts are delivered via alerting profiles.  
Thanks,  
Sarfaraz

---

<div class="post-metadata">

**Author:** ![t\_pawlak](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/t_pawlak/32/14991_2.png) [@t\_pawlak](https://community.dynatrace.com/u/t_pawlak)\
**Post date:** [December 9, 2025, 8:02am UTC](https://community.dynatrace.com/t/create-an-mttd-tile-in-dynatrace-dashboard-using-dql/53565/4 "2025-12-09T08:02:10Z")

</div>

Hi&nbsp;[@sarfarazx01a](https://community.dynatrace.com/user/95764)

Yes — based on how Dynatrace works internally, your 3-minute interpretation is conceptually correct, but from a DQL perspective the platform only exposes the analysis window start and the problem creation time.

So in practice, the only universally reliable MTTD you can calculate in DQL is:

MTTD = problem creation time – analysis start time

Try this:

```markup
fetch events
| filter event.kind == "DAVIS_PROBLEM"
| filter event.status_transition == "CREATED"
| fields
    problem_id = event.id,
    problem_created = timestamp,
    analysis_start = event.start
| fieldsAdd
    MTTD = problem_created - analysis_start
| summarize
    avg_MTTD = avg(MTTD),
    min_MTTD = min(MTTD),
    max_MTTD = max(MTTD)

```

![t_pawlak_0-1765267312164.png](https://global.discourse-cdn.com/dynatrace/original/3X/6/9/693504655428e69e08c2ebdaa73d8441497aa12f.png)
