# Recreating Native Problem Chart Behavior in DQL (Active Problems Over Time)

**URL:** <https://community.dynatrace.com/t/recreating-native-problem-chart-behavior-in-dql-active-problems-over-time/56034>\
**Category:** DQL\
**Tags:** dql\
**Created:** [May 29, 2026, 8:19am UTC](https://community.dynatrace.com/t/recreating-native-problem-chart-behavior-in-dql-active-problems-over-time/56034 "2026-05-29T08:19:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zaidanrizq](https://avatars.discourse-cdn.com/v4/letter/z/c67d28/32.png) [@zaidanrizq](https://community.dynatrace.com/u/zaidanrizq)\
**Post date:** [May 29, 2026, 8:19am UTC](https://community.dynatrace.com/t/recreating-native-problem-chart-behavior-in-dql-active-problems-over-time/56034/1 "2026-05-29T08:19:59Z")

</div>

Hi everyone,  
I’m trying to recreate the problem chart from the Problems menu using DQL, but I’m struggling to match the behavior of the native visualization.

Current approach:

```markup
fetch dt.davis.problems
| makeTimeseries count(), by: {event.status}

```

Current result:

 ![Screenshot 2026-05-29 150309.png](https://global.discourse-cdn.com/dynatrace/original/2X/9/9e2774e9f3d14d5c4930cab22d5c5167b02d4776.png)  
The problem only appears as a single bar at the timestamp field.

Expectation:

 ![Screenshot 2026-05-29 150128.png](https://global.discourse-cdn.com/dynatrace/original/3X/c/c/cc5e4ed76d52298e5422858b2ec26a258227c427.png)

I want the problem to behave like the native Problems chart:

- The bar should start appearing from event.start
- The bar should continue to reappear based on the selected interval
- Example:
  - If interval = 5 minutes
  - And the problem event.status is still OPEN (or event.end is null)
  - Then the same problem should continue contributing to every 5-minute bucket until it is CLOSED

So essentially I’m trying to calculate “active/open problems over time”, not just “problem creation count”.

Has anyone successfully recreated this behavior in DQL?  
Is there a recommended approach/pattern for expanding problem duration across time buckets?

Thanks!

---

<div class="post-metadata">

**Author:** ![MaximilianoML](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/maximilianoml/32/25038_2.png) [@MaximilianoML](https://community.dynatrace.com/u/MaximilianoML)\
**Post date:** [May 29, 2026, 8:51am UTC](https://community.dynatrace.com/t/recreating-native-problem-chart-behavior-in-dql-active-problems-over-time/56034/2 "2026-05-29T08:51:54Z")

</div>

Hello&nbsp;[@zaidanrizq](https://community.dynatrace.com/user/98519)!

I’m not sure if got right, but I think you want something like this:

 ![MaximilianoML_0-1780044584796.png](https://global.discourse-cdn.com/dynatrace/original/2X/2/23b40e6d27089290ce8dd1f3e6d6446a30dfe155.png)

If it’s, you can use this Json below and then use as a dashboard, I made comments on the dashboard so you can understand better:

```javascript
{
  "tiles": {
    "0": {
      "content": "# Problems over time\nThis dashboard recreates the Problems chart behavior by counting problems across their active duration, from `event.start` until `event.end` or `now()`.",
      "type": "markdown"
    },
    "1": {
      "davis": {
        "davisVisualization": {
          "isAvailable": true
        },
        "enabled": false
      },
      "description": "Counts each problem in every interval where it was active.",
      "query": "fetch dt.davis.problems, from: toTimestamp($dt_timeframe_from) - 2h, to: toTimestamp($dt_timeframe_to)\n| filter event.start <= toTimestamp($dt_timeframe_to)\n| filter coalesce(event.end, now()) >= toTimestamp($dt_timeframe_from)\n| makeTimeseries problems = countDistinct(display_id),\n by: { event.status },\n interval: 5m,\n spread: timeframe(from: event.start, to: coalesce(event.end, now()))",
      "querySettings": {
        "defaultSamplingRatio": 10,
        "defaultScanLimitGbytes": 500,
        "enableSampling": false,
        "maxResultMegaBytes": 10,
        "maxResultRecords": 1000
      },
      "title": "Problems over time by status",
      "type": "data",
      "visualization": "barChart",
      "visualizationSettings": {
        "autoSelectVisualization": false,
        "chartSettings": {
          "legend": {
            "position": "right"
          }
        },
        "coloring": {
          "colorRules": [
            {
              "colorMode": "custom-color",
              "comparator": "=",
              "customColor": "#C91313",
              "field": "event.status",
              "type": "string",
              "value": "ACTIVE"
            }
          ]
        }
      }
    },
    "2": {
      "davis": {
        "davisVisualization": {
          "isAvailable": true
        },
        "enabled": false
      },
      "description": "Same logic without splitting by status.",
      "query": "fetch dt.davis.problems, from: toTimestamp($dt_timeframe_from) - 2h, to: toTimestamp($dt_timeframe_to)\n| filter event.start <= toTimestamp($dt_timeframe_to)\n| filter coalesce(event.end, now()) >= toTimestamp($dt_timeframe_from)\n| makeTimeseries problems = countDistinct(display_id),\n interval: 5m,\n spread: timeframe(from: event.start, to: coalesce(event.end, now()))",
      "querySettings": {
        "defaultSamplingRatio": 10,
        "defaultScanLimitGbytes": 500,
        "enableSampling": false,
        "maxResultMegaBytes": 10,
        "maxResultRecords": 1000
      },
      "title": "Total problems over time",
      "type": "data",
      "visualization": "barChart",
      "visualizationSettings": {
        "autoSelectVisualization": false,
        "chartSettings": {
          "legend": {
            "position": "right"
          }
        }
      }
    }
  },
  "variables": [],
  "annotations": [],
  "settings": {
    "defaultTimeframe": {
      "enabled": true,
      "value": {
        "from": "now()-2h",
        "to": "now()"
      }
    }
  },
  "layouts": {
    "0": {
      "h": 3,
      "w": 24,
      "x": 0,
      "y": 0
    },
    "1": {
      "h": 8,
      "w": 24,
      "x": 0,
      "y": 3
    },
    "2": {
      "h": 8,
      "w": 24,
      "x": 0,
      "y": 11
    }
  },
  "importedWithCode": false,
  "version": 21
}

```

I hope it helps you&nbsp;😊

---

<div class="post-metadata">

**Author:** ![zaidanrizq](https://avatars.discourse-cdn.com/v4/letter/z/c67d28/32.png) [@zaidanrizq](https://community.dynatrace.com/u/zaidanrizq)\
**Post date:** [May 29, 2026, 9:00am UTC](https://community.dynatrace.com/t/recreating-native-problem-chart-behavior-in-dql-active-problems-over-time/56034/3 "2026-05-29T09:00:31Z")

</div>

It worked as expected, Thanks a lot!

---

<div class="post-metadata">

**Author:** ![MaximilianoML](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/maximilianoml/32/25038_2.png) [@MaximilianoML](https://community.dynatrace.com/u/MaximilianoML)\
**Post date:** [May 29, 2026, 9:01am UTC](https://community.dynatrace.com/t/recreating-native-problem-chart-behavior-in-dql-active-problems-over-time/56034/4 "2026-05-29T09:01:26Z")

</div>

You’re welcome, glad to help&nbsp;😁
