# DQL Monthly Query for problems

**URL:** <https://community.dynatrace.com/t/dql-monthly-query-for-problems/50494>\
**Category:** DQL\
**Tags:** dql\
**Created:** [February 27, 2025, 7:41pm UTC](https://community.dynatrace.com/t/dql-monthly-query-for-problems/50494 "2025-02-27T19:41:09Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [February 28, 2025, 8:18am UTC](https://community.dynatrace.com/t/dql-monthly-query-for-problems/50494/4 "2025-02-28T08:18:37Z")

</div>

You should use rounded timestamps, not string representation. Also to do proper bar chart it is better to use timerange so single bar spans the time it applies to:

```markup
fetch dt.davis.problems
| summarize { TotalProblemMonthly=count() , ServiceNowTickets=countIf(matchesPhrase(labels.alerting_profile, "ServiceNow")) },
  by:{ timeframe=timeframe( from: timestamp@M, to: timestamp@M+1M ) }
| sort timeframe desc

```

I used time alignment operators:&nbsp;[DQL operators — Dynatrace Docs](https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-query-language/operators#time-alignment).

Result look like this:

 ![krzysztof_hoja_0-1740729792108.png](https://global.discourse-cdn.com/dynatrace/original/1X/e05facd2e968593f51816755b732a053350b2eb4.png)

 ![krzysztof_hoja_1-1740730602967.png](https://global.discourse-cdn.com/dynatrace/original/3X/f/5/f5c6a387f43d7f92fac97b6b39690ee3096ed2cc.png)

---

_[View the full topic](https://community.dynatrace.com/t/dql-monthly-query-for-problems/50494)._
