# How do I merge DQL queries together?

**URL:** <https://community.dynatrace.com/t/how-do-i-merge-dql-queries-together/51356>\
**Category:** DQL\
**Tags:** dql, dynatrace-managed\
**Created:** [April 24, 2025, 8:38am UTC](https://community.dynatrace.com/t/how-do-i-merge-dql-queries-together/51356 "2025-04-24T08:38:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![badgerfifteen](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@badgerfifteen](https://community.dynatrace.com/u/badgerfifteen)\
**Post date:** [April 24, 2025, 8:38am UTC](https://community.dynatrace.com/t/how-do-i-merge-dql-queries-together/51356/1 "2025-04-24T08:38:36Z")

</div>

Hi,

I am trying to return some fields from dt.entity.host as well as data from dt.host.disk.used.percent.

However, when I try to append them, I get null values for Utilisation.

Here is my current DQL code:

```auto
fetch dt.entity.host
| fieldsAdd tags
| fieldsAdd entity.name
| expand tags
| append [
timeseries { percent = avg(dt.host.disk.used.percent), used = avg(dt.host.disk.used), avail = avg(dt.host.disk.avail) }, by: { dt.entity.host, dt.entity.disk }
| fieldsAdd Utilisation = arrayAvg(percent)
| fieldsAdd entityName(dt.entity.host)
]

```

Any ideas?

---

<div class="post-metadata">

**Author:** ![sia\_h](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@sia\_h](https://community.dynatrace.com/u/sia_h)\
**Post date:** [April 24, 2025, 12:09pm UTC](https://community.dynatrace.com/t/how-do-i-merge-dql-queries-together/51356/2 "2025-04-24T12:09:05Z")

</div>

You could either do a [lookup:](https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-query-language/commands/correlation-and-join-commands#lookup)

```markup
timeseries { percent = avg(dt.host.disk.used.percent), used = avg(dt.host.disk.used), avail = avg(dt.host.disk.avail) }, by: { dt.entity.host, dt.entity.disk }
| fieldsAdd Utilisation = arrayAvg(percent)
| fieldsAdd entityName(dt.entity.host)
| lookup [ fetch dt.entity.host 
| fields entity.name, id, tags ], sourceField:dt.entity.host, lookupField:id

```

or use the [entityAttr](https://docs.dynatrace.com/docs/shortlink/general-functions#entity-attr):

```markup
timeseries { percent = avg(dt.host.disk.used.percent), used = avg(dt.host.disk.used), avail = avg(dt.host.disk.avail) }, by: { dt.entity.host, dt.entity.disk }
| fieldsAdd Utilisation = arrayAvg(percent)
| fieldsAdd entityName(dt.entity.host)
| fieldsAdd tags = entityAttr(dt.entity.host, "tags")

```
