# Entity Tags DQL

**URL:** <https://community.dynatrace.com/t/entity-tags-dql/52056>\
**Category:** DQL\
**Tags:** dql\
**Created:** [June 12, 2025, 9:20am UTC](https://community.dynatrace.com/t/entity-tags-dql/52056 "2025-06-12T09:20:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pablo2](https://avatars.discourse-cdn.com/v4/letter/p/ac91a4/32.png) [@Pablo2](https://community.dynatrace.com/u/Pablo2)\
**Post date:** [June 12, 2025, 9:20am UTC](https://community.dynatrace.com/t/entity-tags-dql/52056/1 "2025-06-12T09:20:34Z")

</div>

I have a DQL that shows a series of fields that I am interested in, one of them is entity\_tags.But I only want one of the tags to appear in that field, not all of them (if it has that tag) otherwise I want an empty or null to appear.This is the DQL:fetch dt.davis.problems  
| filter isNull(dt.davis.is\_duplicate) OR NOT dt.davis.is\_duplicate  
| filter in(labels.alerting\_profile, “[AESM] Alertas\_24x7”)  
| fields display\_id, event.name, event.status, event.description,entity\_tags, event.start, event.end, event.id, dt.davis.problems, affected\_entity\_ids, affected\_entity\_types,root\_cause\_entity\_name  
| expand affected\_entity\_ids  
| lookup  
[  
fetch dt.entity.host  
| fieldsAdd osType  
], sourceField:affected\_entity\_ids, lookupField:id, fields:{osType}  
| expand affected\_entity\_ids  
| lookup  
[  
fetch dt.entity.synthetic\_test  
| fieldsAdd entity.name  
], sourceField:affected\_entity\_ids, lookupField:id, fields:{entity.name}  
| fieldsRemove event.status  
| fieldsAdd ids\_sorted = arraySort(affected\_entity\_ids, direction:“ascending”)  
| fields `Activo`=problems,Inicio=event.start, Fin=event.end,entity\_tags,display\_id, Tipo=event.name,Monitor=entity.name, osType,Causa\_Raiz=root\_cause\_entity\_name,Descripcion=event.description, event.id  
| sort Inicio desc  
| dedup event.id, sort:{Monitor}  
| fieldsAdd Monitor = if(isNull(Monitor), “KeepAlive”, else:Monitor)  
| fieldsAdd osType = if(isNull(osType), “N/A”, else:osType)  
| fieldsAdd Causa\_Raiz = if(isNull(Causa\_Raiz), “No determinada”, else:Causa\_Raiz)This is the actual table:

 ![Pablo2_0-1749719985882.png](https://global.discourse-cdn.com/dynatrace/original/3X/4/e/4ec3a4b70a93042dc67637caa10cfa08fe4a8f55.png)

---

<div class="post-metadata">

**Author:** ![TracingMySanity](https://avatars.discourse-cdn.com/v4/letter/t/858c86/32.png) [@TracingMySanity](https://community.dynatrace.com/u/TracingMySanity)\
**Post date:** [June 12, 2025, 4:24pm UTC](https://community.dynatrace.com/t/entity-tags-dql/52056/2 "2025-06-12T16:24:51Z")

</div>

The `entity_tags` field is an array, so you should be able to expand it and then filter on specific tag(s).

```markup
fetch dt.davis.problems
| filter isNull(dt.davis.is_duplicate) OR NOT dt.davis.is_duplicate
| fields display_id, event.name, event.status, event.description,entity_tags, event.start, event.end, event.id, dt.davis.problems, affected_entity_ids, affected_entity_types,root_cause_entity_name
| expand entity_tags
| filter in(entity_tags, {"AESM_App_Purpose:NED", "AESM_App_Purpose:AreaClienteAXA"})

```
