# DQL if no records returned i want to show in honeycomb view as 0

**URL:** <https://community.dynatrace.com/t/dql-if-no-records-returned-i-want-to-show-in-honeycomb-view-as-0/55823>\
**Category:** Open Q&A\
**Tags:** dql, dashboards\
**Created:** [May 6, 2026, 5:36pm UTC](https://community.dynatrace.com/t/dql-if-no-records-returned-i-want-to-show-in-honeycomb-view-as-0/55823 "2026-05-06T17:36:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![learndt](https://avatars.discourse-cdn.com/v4/letter/l/aca169/32.png) [@learndt](https://community.dynatrace.com/u/learndt)\
**Post date:** [May 6, 2026, 5:36pm UTC](https://community.dynatrace.com/t/dql-if-no-records-returned-i-want-to-show-in-honeycomb-view-as-0/55823/1 "2026-05-06T17:36:45Z")

</div>

timeseries { cpu\_usage\_percent = avg(dt.host.cpu.usage) }, by:{ dt.entity.host }, nonempty:true  
| fieldsAdd hostname = entityName(dt.entity.host)  
| filter in(hostname, $DEVICENAME) // optional: filter by a list variable  
| fieldsAdd `% usage` = arrayLast(cpu\_usage\_percent)  
| fieldsAdd output = if((`% usage` \> 90), `% usage`, else: 0)  
| summarize `Usage \> 90%` = sum(output), by: {dt.entity.host}  
| fields `Usage \> 90%`, entityName(dt.entity.host)  
| filterOut `Usage \> 90%` \< 90

If there is no record returned (If there are no hosts with CPU usage greater than 90%) then instead of displaying as No records, adjust timeframe default message, I want it to show as 0 and as honeycomb view.

How to achieve it, help with modified query

---

<div class="post-metadata">

**Author:** ![MaximilianoML](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/maximilianoml/32/25038_2.png) [@MaximilianoML](https://community.dynatrace.com/u/MaximilianoML)\
**Post date:** [May 6, 2026, 6:38pm UTC](https://community.dynatrace.com/t/dql-if-no-records-returned-i-want-to-show-in-honeycomb-view-as-0/55823/2 "2026-05-06T18:38:54Z")

</div>

Hello&nbsp;[@learndt](https://community.dynatrace.com/user/99239)!

If think you want this below:

```javascript
timeseries cpu_usage_percent = avg(dt.host.cpu.usage),
  by:{ dt.entity.host },
  nonempty:true
| fieldsAdd hostname = entityName(dt.entity.host)
| filter in(hostname, $DEVICENAME)
| fieldsAdd `% usage` = arrayLast(cpu_usage_percent)
| filter `% usage` > 90
| summarize `Usage > 90%` = count()
| fieldsAdd label = "Hosts with CPU > 90%"
| fields label, `Usage > 90%`

```

I hope it helps&nbsp;😊
