# One missing timeseries metric in DQL query, result in "There are no records" for the whole query

**URL:** <https://community.dynatrace.com/t/one-missing-timeseries-metric-in-dql-query-result-in-there-are-no-records-for-the-whole-query/44638>\
**Category:** DQL\
**Tags:** dql, dynatrace-managed, grail, notebooks\
**Created:** [March 14, 2024, 3:38am UTC](https://community.dynatrace.com/t/one-missing-timeseries-metric-in-dql-query-result-in-there-are-no-records-for-the-whole-query/44638 "2024-03-14T03:38:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cabeywardhana](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@cabeywardhana](https://community.dynatrace.com/u/cabeywardhana)\
**Post date:** [March 14, 2024, 3:38am UTC](https://community.dynatrace.com/t/one-missing-timeseries-metric-in-dql-query-result-in-there-are-no-records-for-the-whole-query/44638/1 "2024-03-14T03:38:40Z")

</div>

I have a complex query which is incorporating multiple metrics in one DQL query via multiple joins.

My issue is that if one of the metric(the whole timeseries) is missing, the whole query returns&nbsp;“There are no records”

```markup
timeseries avg(metric1)
    interval: 10m
    by: {id}
| join [ 
    timeseries avg(metric2, default:0), nonempty:true,  
    interval: 10m
    by: {id}
], on: {_id}, prefix:"prefix1"
| join [
    timeseries avg(metric3), 
    interval: 10m
    by: {id}
], on: {_id}, prefix:"prefix2"

```

I have tried adding nonempty and default value to DQL query as suggested [here](https://docs.dynatrace.com/docs/platform/grail/dynatrace-query-language/commands/metric-commands#expand--nonempty-parameter)&nbsp;for the missing metric without any luck. e.g. metric2 is missing the timeseries.

```markup
timeseries avg(metric2, default:0), nonempty:true,

```

The result I am expecting is that the complex query will still return a result with the metrics data from other two(available) timeseries + default values for the missing timeseries metric.&nbsp;  
Is this possible ?

---

<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:** [March 15, 2024, 7:55pm UTC](https://community.dynatrace.com/t/one-missing-timeseries-metric-in-dql-query-result-in-there-are-no-records-for-the-whole-query/44638/2 "2024-03-15T19:55:22Z")

</div>

Before I attempt to explain, here are my test data. I will use 2 metrics for 2 hosts. First metric is available for both host while second only for one:

 ![krzysztof_hoja_0-1710531718715.png](https://global.discourse-cdn.com/dynatrace/original/3X/c/6/c6d2ef9c459d8b637b8e367003b3f672f0f34400.png)

If I retrieve both metrics using single _ **timeseries** _ command, the result would look like:

 ![krzysztof_hoja_1-1710531864807.png](https://global.discourse-cdn.com/dynatrace/original/2X/a/a0a46ef0800436ff515c143ddf6e796c995cd501.png)

As you can see only one record with pair of metrics is returned for the host where both metrics are available. To have both metrics using such construct, I would use _ **union:true** _ option of _ **timeseries** _ command.

 ![krzysztof_hoja_2-1710532048690.png](https://global.discourse-cdn.com/dynatrace/original/2X/3/3631c53a94ab4430fb3806ab98005cf10885d03d.png)

this option cases that records/rows when some metrics are missing are not eliminated.&nbsp;Here is how _ **join** _ command behaves with the same data:

 ![krzysztof_hoja_3-1710532179654.png](https://global.discourse-cdn.com/dynatrace/original/3X/5/d/5dbfabbf47b449d518ec4b1a50688d4b7639182c.png)

But join _ **command** _ offers also option&nbsp;_ **kind:leftOuter** _ which does not eliminate records returned by basic query where corresponding record from subquery is missing

 ![krzysztof_hoja_4-1710532345049.png](https://global.discourse-cdn.com/dynatrace/original/2X/6/60cc2242ce2e8d6b34bbfe516df72e1deff6255a.png)

Of course first query has to provide superset of what subquery returns.

Kris

---

<div class="post-metadata">

**Author:** ![cabeywardhana](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@cabeywardhana](https://community.dynatrace.com/u/cabeywardhana)\
**Post date:** [March 18, 2024, 8:50pm UTC](https://community.dynatrace.com/t/one-missing-timeseries-metric-in-dql-query-result-in-there-are-no-records-for-the-whole-query/44638/3 "2024-03-18T20:50:00Z")

</div>

[@krzysztof\_hoja](https://community.dynatrace.com/user/25373)&nbsp;Thank you for the solution, your awesome suggestion works for my scenario.
