# Fetch and Sort Problems by Application Using DQL

**URL:** <https://community.dynatrace.com/t/fetch-and-sort-problems-by-application-using-dql/50096>\
**Category:** DQL\
**Tags:** dql, problems, dashboards\
**Created:** [February 4, 2025, 2:59pm UTC](https://community.dynatrace.com/t/fetch-and-sort-problems-by-application-using-dql/50096 "2025-02-04T14:59:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjena7810](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@sjena7810](https://community.dynatrace.com/u/sjena7810)\
**Post date:** [February 4, 2025, 2:59pm UTC](https://community.dynatrace.com/t/fetch-and-sort-problems-by-application-using-dql/50096/1 "2025-02-04T14:59:16Z")

</div>

Hi all!

I have a dashboard where I want to fetch all the active problems and group the problems together by application. Then, using a variable that sorts through applications, I want to use that variable as a multi-select filter.

However, when I fetch active problems, I don’t see any category that groups together problems by application. I see options to group by alerting\_profile, display\_id, affected\_entity\_id, etc…, but nothing to group by app.

 ![sjena7810_0-1738681098867.png](https://global.discourse-cdn.com/dynatrace/original/2X/7/762380ce6a71c2ec9f6bb2aacfd1d6d486218149.png)

Is there any way to sort through the list of active problems and group them together by application?

---

<div class="post-metadata">

**Author:** ![DavidRitter](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/davidritter/32/10328_2.png) [@DavidRitter](https://community.dynatrace.com/u/DavidRitter)\
**Post date:** [February 4, 2025, 7:18pm UTC](https://community.dynatrace.com/t/fetch-and-sort-problems-by-application-using-dql/50096/2 "2025-02-04T19:18:17Z")

</div>

Just to clarify, what do you mean by application? Do you mean Dynatrace Application (RUM)? If you mean RUM app you could try something like this:

fetch dt.davis.problems  
| expand affected\_entity\_types  
| filter affected\_entity\_types == “dt.entity.application”  
| dedup display\_id

To get all of the problems related to your DT RUM applications

---

<div class="post-metadata">

**Author:** ![sjena7810](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@sjena7810](https://community.dynatrace.com/u/sjena7810)\
**Post date:** [February 5, 2025, 7:38pm UTC](https://community.dynatrace.com/t/fetch-and-sort-problems-by-application-using-dql/50096/3 "2025-02-05T19:38:49Z")

</div>

Hey, thanks for the response David.

By “application”, I mean the applications at our firm that we have OneAgent installed on (Salesforce, Docusign, etc…).

I want to get the total number of problems per application (or even management zone). However, when I fetch Davis problems, I don’t see any options (columns) that allow me to filter by application (or anything even remotely close).

```javascript
| fetch dt.davis.problems

| expand affected_entity_types

```

When I run this, none of the columns signify the application that the problem occurs on. When I run your DQL query, I don’t see the actual names of apps, just whether or not the problem occurred on an application, host, server, etc.

---

<div class="post-metadata">

**Author:** ![Maheedhar\_T](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/maheedhar_t/32/155_2.png) [@Maheedhar\_T](https://community.dynatrace.com/u/Maheedhar_T)\
**Post date:** [February 6, 2025, 4:18am UTC](https://community.dynatrace.com/t/fetch-and-sort-problems-by-application-using-dql/50096/4 "2025-02-06T04:18:49Z")

</div>

Heya,  
You can filter by entity\_ids like this.

```markup
fetch dt.davis.problems
| expand affected_entity_ids
| summarize count(), by: affected_entity_ids

```

however, if you want application names instead of ids then it would be complex one as the DQL will only allow fetching entities by their type and get their name like you can get an application name by using a query like this

```markup
fetch dt.entity.application
| filter id == "APPLICATION-<ALPHA-NUMERIC-ID>"
| fields entity.name

```

Since you mentioned you are using dashboard itself, I’d suggest use the query1 as a variable and write a JS code that would fetch the entity.name by the entity id.

Refer this on how you can write JS code&nbsp;[DQL Query | Dynatrace Developer](https://developer.dynatrace.com/develop/sdks/client-query/)

Hope this helps..

Regards,  
Maheedhar.

---

<div class="post-metadata">

**Author:** ![sjena7810](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@sjena7810](https://community.dynatrace.com/u/sjena7810)\
**Post date:** [February 7, 2025, 2:36pm UTC](https://community.dynatrace.com/t/fetch-and-sort-problems-by-application-using-dql/50096/5 "2025-02-07T14:36:27Z")

</div>

Hi Maheedhar, thanks for the response.

When you say:

```auto
| filter id == "APPLICATION-<ALPHA-NUMERIC-ID>"

```

What does ALPHA-NUMERIC-ID refer to? Is that the display ID of the problem? Like, P-12345?
