# Replace "no data" with "0" in a dashboard

**URL:** <https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063>\
**Category:** Dashboarding\
**Tags:** dashboards-classic\
**Created:** [February 8, 2022, 12:29pm UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063 "2022-02-08T12:29:08Z")\
**Posts on this page:** 14\
**Page:** 2

<div class="post-metadata">

**Author:** ![fcourbon](https://avatars.discourse-cdn.com/v4/letter/f/df788c/32.png) [@fcourbon](https://community.dynatrace.com/u/fcourbon)\
**Post date:** [September 29, 2022, 3:05pm UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/21 "2022-09-29T15:05:57Z")

</div>

Hi&nbsp;[@DavidFearns](https://community.dynatrace.com/user/43197)&nbsp;, I had a chance to check and the default(0) should replace missing data with 0 so calculations can actually take place. For a Table or Single value visualization, make sure you are selecting the fold transformation that fits your needs, the Auto might not yield the expected results.

I am showing below a made up example where there is no intersecting data yet the calculations are taking place thanks to the default(0) and selecting Average for the fold transformation.

 ![calculated.png](https://global.discourse-cdn.com/dynatrace/original/2X/2/2d23a1453d8b49b8ae7d9f7903ab91e6e79142d5.png)

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [September 29, 2022, 9:00pm UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/22 "2022-09-29T21:00:43Z")

</div>

[@fcourbon](https://community.dynatrace.com/user/52880)&nbsp;anyway we still need to have a transformation to set default value even if there is no data point. Just when displaying any counter.&nbsp; Try to explain it to the management, they are seeing “ **No data** ” instead of **0** on the dashboard.

It applies even for the builtin metrics, for example reporting the application errors:

```markup
builtin:apps.mobile.reportedErrorCount
:filter(and(or(in("dt.entity.mobile_application",entitySelector("type(mobile_application),entityName.equals(~"easyTravel Mobile (mainframe)~")")))))
:splitBy()
:sum
:default(0)

```

Just look at this [thread](https://community.dynatrace.com/post/180377#M2181)&nbsp;for examples of other situations. There is definitely a need to force a default value, even there is no datapoint.

---

<div class="post-metadata">

**Author:** ![zietho](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/zietho/32/41733_2.png) [@zietho](https://community.dynatrace.com/u/zietho)\
**Post date:** [September 30, 2022, 7:18am UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/23 "2022-09-30T07:18:34Z")

</div>

[@Julius\_Loman](https://community.dynatrace.com/user/3364). I guess both,&nbsp;[@fcourbon](https://community.dynatrace.com/user/52880)&nbsp;and I agree. It’s not that we don’t see a “need” for this but that there is two distinct parts to this and not both are equally easy to achieve in terms of effort.

1. How do you display a result for simple metrics (table, single value) that’s something we can provide in the Data explorer and should fix most likely the majority of cases? E.g, have an input field saying "default.. " that allows you to put whatever, for example, “$”.
2. How do you display a result of metric expression? Here we need&nbsp;[@fcourbon](https://community.dynatrace.com/user/52880)because we can’t solve this in the Data explorer

for 1, however, there is still one central question: Where would any such default make the most sense to be set?

- For each tile in the Data explorer? (flexible but tedious if you need to do this often)
- Or, on a dashboard level (fast but very limited for different metrics)

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [September 30, 2022, 8:26am UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/24 "2022-09-30T08:26:08Z")

</div>

[@zietho](https://community.dynatrace.com/user/23400)&nbsp;My two cents:

1. Input field is OK for the Data Explorer common use case and easy to use by non Dynatrace experts. In most situations I would just put zero (0) , maybe dash (-) - just for displaying.
2. If possible, I would just enrich the **:default** transformation with an optional parameter to force the value even if there is no datapoint. For example: **:default(0, force)**&nbsp;or something like that. This would solve also 1) unless you want to display non-numeric value.

I would not try to solve it on a dashboard level and leave it to an individual data explorer tile.

---

<div class="post-metadata">

**Author:** ![jegron](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jegron/32/12797_2.png) [@jegron](https://community.dynatrace.com/u/jegron)\
**Post date:** [September 30, 2022, 8:37am UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/25 "2022-09-30T08:37:58Z")

</div>

Totally agree with&nbsp;[@Julius\_Loman](https://community.dynatrace.com/user/3364)&nbsp;use cases.

I would add that in a supervision logic, it is painful to see a host or a tile disappear because the datasource is temporarily unavailable.

---

<div class="post-metadata">

**Author:** ![WesL](https://avatars.discourse-cdn.com/v4/letter/w/b9bd4f/32.png) [@WesL](https://community.dynatrace.com/u/WesL)\
**Post date:** [October 11, 2022, 6:55pm UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/26 "2022-10-11T18:55:00Z")

</div>

While I understand the approach you are putting forward, let’s look at it from a customer-centric response.&nbsp; We, the Dynatrace Community, are telling you that there is a need for no data = 0.&nbsp; In my case, when designing an executive dashboard, I would want the data across the dashboard to be uniform and show zero with a green indicator instead of “no data” which makes it honestly look like Dynatrace isn’t working.&nbsp; &nbsp;Please reconsider the approach.

---

<div class="post-metadata">

**Author:** ![PedroDeodato](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pedrodeodato/32/32284_2.png) [@PedroDeodato](https://community.dynatrace.com/u/PedroDeodato)\
**Post date:** [October 12, 2022, 9:26am UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/27 "2022-10-12T09:26:29Z")

</div>

Hey&nbsp;[@EnriqueOriol](https://community.dynatrace.com/user/41974)&nbsp;,

I think that [@WesL](https://community.dynatrace.com/user/55290)’s&nbsp;and&nbsp;[@arora138](https://community.dynatrace.com/user/53837)&nbsp;'s use cases are very valid and&nbsp;I can relate to both pretty well.

I now also understand your explanation on the difference between data points with NULL values and no data point at all, and the difficulties that a “no data point” brings to the application of a default(0) operator, for example.

However, the need still stands.

The executives that&nbsp;[@WesL](https://community.dynatrace.com/user/55290)&nbsp;mentioned still need some neat to handle this.

And I think the term “handle” is really the best one on this case: we get it that “this is how metrics are intended to work”, but what if “how metrics are intended to work” do not solve the Users needs?

When a program spits out an Exception, it’s not the end of the world… we just need to figure out a way to handle it 🙂

Some suggestions will follow:

1. In the case of a Single Value data explorer, wouldn’t it be simple to just interpret a null value = no data point at all = zero ? Again, it should be optional and could even be an option specific to the Single Value chart, or others that to not require to show timestamps on data points (eg. top list, table, etc). It would be more natural to a regular (not proficient) user (like an executive): “start at zero and then sum up from there”.
2. In visualization that need to show data points (eg. graph), the default operator could be a bit more advanced, with the addition of just one parameter: frequency. So, something like :default(0,1m) would “create”/“simulate” ‘fake’/‘dummy’ datapoints, with the frequency of 1 minute with the default value of 0, whenever the metric didn’t show any data points on the timeframe. NOTE: these&nbsp;‘fake’/‘dummy’ datapoints wouldn’t be stored anythere… would just need to be rendered in the visualization, to fill in gaps and show the desired zeroes whenever need be.

Just two ideas!

Maybe the best solution is something completely different: and I’m 100% fine with it.  
What I defend the most is that we do not settle at “this is how metrics are intended to work”, because sometimes users need something that goes beyond how something was intended to work… that’s what makes us evolve 🙂

---

<div class="post-metadata">

**Author:** ![EnriqueOriol](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/enriqueoriol/32/21765_2.png) [@EnriqueOriol](https://community.dynatrace.com/u/EnriqueOriol)\
**Post date:** [October 13, 2022, 10:05am UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/28 "2022-10-13T10:05:09Z")

</div>

Hi&nbsp;[@PedroDeodato](https://community.dynatrace.com/user/40725)&nbsp;, the problem is that, if we don’t have any data for the given timeframe, displaying a zero instead of a “No data” message might be misleading because there’s no guarantee that your query is really valid.

I mean, taking&nbsp;[@arora138](https://community.dynatrace.com/user/53837)&nbsp;example (built-in metric with some filter that returns no data for the whole selected period). In that case we are basically getting no results from our database. We can display an array of zeros and it would be meaningful for you, for sure, but… imagine the same query with a typo in the filter. In that case, we will get as well, no results from the database, but I don’t think an array of zeroes would make any sense in this specific scenario. On the contrary, you would probably want to know that something is wrong.  
As a workaround for your concrete scenario&nbsp;[@arora138](https://community.dynatrace.com/user/53837), you can always use a calculated metric to make sure you are displaying zeroes, as long as the aggregated metric is always ingesting data from at least one host. However, you will be in the situation explained before, if there’s a typo in the filter value you write, we will not know.

I mean, you can do  
_( (built-in:metric \* 0) + built-in:metric:filtered:auto:default(0) )._  
 The _:auto:default(0)_ here provides you with zeroes matching the first metric, so the calculation can be executed.

_G.e.&nbsp;  
(builtin:kubernetes.pods:splitBy()\*0 + builtin:kubernetes.pods:filter(and(or(eq(“k8s.cluster.name”,your-filter)))):auto:default(0)):sort(value(auto,descending)):limit(10)_

---

<div class="post-metadata">

**Author:** ![allison\_almeida](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/allison_almeida/32/28401_2.png) [@allison\_almeida](https://community.dynatrace.com/u/allison_almeida)\
**Post date:** [October 18, 2022, 5:03pm UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/29 "2022-10-18T17:03:59Z")

</div>

Best aligned on this links:

[https://community.dynatrace.com/t5/Dynatrace-product-ideas/Data-Explorer-Change-No-Data-for-calculated-metric-counts-to/idi-p/185918](https://community.dynatrace.com/post/185918)

Guess the best approach:

“… would just enrich the **:default** transformation with an optional parameter to force the value even if there is no datapoint. For example: **:default(0, force)**&nbsp;or something like that …”

[https://community.dynatrace.com/t5/Dynatrace-product-ideas/Data-Explorer-Change-No-Data-for-calculated-metric-counts-to/idc-p/195506/highlight/true#M32951](https://community.dynatrace.com/post/195506)

---

<div class="post-metadata">

**Author:** ![Tom\_Eaton](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/tom_eaton/32/27852_2.png) [@Tom\_Eaton](https://community.dynatrace.com/u/Tom_Eaton)\
**Post date:** [March 31, 2023, 10:10pm UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/30 "2023-03-31T22:10:11Z")

</div>

You can now use defualt(0,always)&nbsp;  
Use the metric selector (Data Explorer Advance) to use it. - it has to come after a splitby()

Doc:&nbsp;[Metrics API - Metric selector — Dynatrace Docs](https://www.dynatrace.com/support/help/shortlink/api-metrics-v2-selector#default)

---

<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 13, 2024, 3:35am UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/31 "2024-03-13T03:35:38Z")

</div>

[@Tom\_Eaton](https://community.dynatrace.com/user/53035)&nbsp;is there something similar available for DQL in Grail ?

---

<div class="post-metadata">

**Author:** ![Tom\_Eaton](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/tom_eaton/32/27852_2.png) [@Tom\_Eaton](https://community.dynatrace.com/u/Tom_Eaton)\
**Post date:** [March 13, 2024, 3:14pm UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/32 "2024-03-13T15:14:20Z")

</div>

Hello&nbsp;[@cabeywardhana](https://community.dynatrace.com/user/71265),

Yes there is! We can use a&nbsp;combination of the&nbsp;nonempty&nbsp;and&nbsp;default&nbsp;parameters. See the below screenshot from the documentation:

 ![Tom_Eaton_0-1710342822230.png](https://global.discourse-cdn.com/dynatrace/original/2X/b/b6b118a7ac8b1be0277a6899771cd6eb369df1c1.png)

> **[DQL metric commands](https://docs.dynatrace.com/docs/platform/grail/dynatrace-query-language/commands/metric-commands#expand--nonempty-parameter)**
>
> DQL metric commands

---

<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, 4:32am UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/33 "2024-03-14T04:32:03Z")

</div>

Thank you for the quick reply Tom.&nbsp; I have tried your solution and my scenario looks a bit different.&nbsp;&nbsp;  
I have asked a new question [here](https://community.dynatrace.com/topic/239840) for my scenario. Thank you again.

---

<div class="post-metadata">

**Author:** ![jebog](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@jebog](https://community.dynatrace.com/u/jebog)\
**Post date:** [November 27, 2025, 10:33am UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/34 "2025-11-27T10:33:34Z")

</div>

With this :default(0,always), i got this message

“The :default operator could not be applied as it requires at least one written data point for the metric in the query timeframe.Consider adding the `always` parameter (for example, `:default(0, always)`)”

I have to set this :default(0, Always)

[Previous page](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063.md?page=1)
