# DQL - show detected services number trend

**URL:** <https://community.dynatrace.com/t/dql-show-detected-services-number-trend/49177>\
**Category:** DQL\
**Tags:** dql\
**Created:** [December 3, 2024, 4:18pm UTC](https://community.dynatrace.com/t/dql-show-detected-services-number-trend/49177 "2024-12-03T16:18:53Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [December 6, 2024, 11:14am UTC](https://community.dynatrace.com/t/dql-show-detected-services-number-trend/49177/2 "2024-12-06T11:14:22Z")

</div>

Yes, second approach is as good start. Here is my query:

```markup
timeseries {req=sum(dt.service.request.count), timestamp=start()}, by:{dt.entity.service}, from:now()-10d, to:now(), interval:24h
| fieldsAdd d=record(req=req[], timestamp=timestamp[])
| expand d 
| filterOut isNull(d[req])
| makeTimeseries service_count=countDistinct(dt.entity.service), interval: 24h, time: d[timestamp]

```

We need to unwrap request count timeseries and in order no too lose information to which information each datapoint belongs we need to user special function _**start()**_ and later combine it with each datapoint in a record.  
After expand we need to get read rows where number of request was null - these are days when “service did not exists”. Now we can build new timeseries with _ **makeTimeseries** _ when each datapoint will be count of unique service entity ids.

 ![krzysztof_hoja_0-1733483635286.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/d/3dd533eed47d441fe312b608770557886305b6a0.png)

---

_[View the full topic](https://community.dynatrace.com/t/dql-show-detected-services-number-trend/49177)._
