# 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:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Malaik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/malaik/32/32673_2.png) [@Malaik](https://community.dynatrace.com/u/Malaik)\
**Post date:** [February 8, 2022, 12:29pm UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/1 "2022-02-08T12:29:08Z")

</div>

Hello All,

in the tile bellow, how can I replace “no data” by “0”?

 ![Malaik_0-1644323293331.png](https://global.discourse-cdn.com/dynatrace/original/2X/d/d09f3845c52cd1b9278ad208040b21c2f6533cba.png)

Thanks for your help and have a good day.

---

<div class="post-metadata">

**Author:** ![a\_chiaravalle](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@a\_chiaravalle](https://community.dynatrace.com/u/a_chiaravalle)\
**Post date:** [March 4, 2022, 5:25pm UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/2 "2022-03-04T17:25:06Z")

</div>

Hi

I have the same question

Have you solved this problem in some way?

thanks

Antonello

---

<div class="post-metadata">

**Author:** ![Malaik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/malaik/32/32673_2.png) [@Malaik](https://community.dynatrace.com/u/Malaik)\
**Post date:** [March 6, 2022, 5:09am UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/3 "2022-03-06T05:09:52Z")

</div>

Hi,

Not yet work in progress, but the support it seems that not possible t this time.

---

<div class="post-metadata">

**Author:** ![Alejandro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/alejandro/32/5595_2.png) [@Alejandro](https://community.dynatrace.com/u/Alejandro)\
**Post date:** [March 8, 2022, 4:19pm UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/4 "2022-03-08T16:19:48Z")

</div>

Hi,

In the Data Explorer there is the option of using the :default operator. This fills empty values with an indicated one, ie: :default(0).  
However this only works if the specific metric has any values in the selected timeframe. If not, the current behaviour is to display a No Data message and no 0 value can be displayed.

Regards

---

<div class="post-metadata">

**Author:** ![Malaik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/malaik/32/32673_2.png) [@Malaik](https://community.dynatrace.com/u/Malaik)\
**Post date:** [March 9, 2022, 4:56am UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/5 "2022-03-09T04:56:26Z")

</div>

Hi&nbsp;[@Alejandro](https://community.dynatrace.com/user/43962)

This is not logic,

I Used&nbsp;:default(0) before and its not work.

If the specific metric has any values in the selected timeframe, for sure the value will be different from 0 even we are not using the&nbsp;:default(0).

Thanks

---

<div class="post-metadata">

**Author:** ![DavidFearns](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@DavidFearns](https://community.dynatrace.com/u/DavidFearns)\
**Post date:** [May 4, 2022, 10:45am UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/6 "2022-05-04T10:45:09Z")

</div>

Can you change the ‘No Data’ result when searching on metric counts in a given timeframe to show 0 (zero) instead.

I use the Code function to show Failed Request Counts filtered across different dimensions (DC, Service Procedence, User Agent) and create calculations with them, if the result is ‘No data’ then my calculation does not work. If it can be changed to a zero then it will work.

Thanks,

Dave

---

<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:** [May 30, 2022, 2:33pm UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/7 "2022-05-30T14:33:58Z")

</div>

I’m having the exact same issue…

Still no updates on this one ?

Thanks!

---

<div class="post-metadata">

**Author:** ![echwallah](https://avatars.discourse-cdn.com/v4/letter/e/9e8a1a/32.png) [@echwallah](https://community.dynatrace.com/u/echwallah)\
**Post date:** [May 30, 2022, 4:44pm UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/8 "2022-05-30T16:44:46Z")

</div>

I tend to think “NO data” semantically means there is no values coming in for some reason. Providing 0 as the default implies we have values but the value is zero. Zero is just a value like any other 1,2,3 and so on. “NO data” means something different in my opinion

---

<div class="post-metadata">

**Author:** ![Malaik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/malaik/32/32673_2.png) [@Malaik](https://community.dynatrace.com/u/Malaik)\
**Post date:** [May 31, 2022, 6:56am UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/9 "2022-05-31T06:56:11Z")

</div>

Hello&nbsp;[@PedroDeodato](https://community.dynatrace.com/user/40725)

Still the same.

---

<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:** [May 31, 2022, 8:16am UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/10 "2022-05-31T08:16:45Z")

</div>

“NO data” means there’s no value tracked for the given timeframe, and it makes sense to show it this way instead of displaying 0 value, otherwise it will be misleading and you might think there’s data reported during that period while that’s not the case.

On the other side, the _default(0)_ operator replaces all _NULL_ values by _0_. It is completely different because in this case there is data ingested for the given timeframe, but for whatever reason, the value attached to those events is empty.

---

<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:** [June 1, 2022, 10:20am UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/11 "2022-06-01T10:20:04Z")

</div>

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

I understand the “NO DATA” meaning.

However, there are some use-cases where a null does have a practical meaning, when translated to a zero.

A Client of ours uses a Custom Extension that finds the number of ocurrences of a given event using a SQL query.

When the extension can’t find any, it doesn’t inject a zero: it simply does not inject anything.

In this case, of a Custom Extension developed by the Client, a way to “mask” the null as a zero would be helpful to others who read the info on the dashboard.

As you stated, the :default(0) transformation only works if there has been data ingested for the given timeframe.

As it is optional to place, couldn’t this transformation work when there is no data for the timeframe, as well?

Then, it would be a designer’s choice: to show it as “no data” or as a zero.

Our only statement is that there should be a way to treat the missing data as expected behaviour: replacing it with a zero should be an option, in our honest opinion.

---

<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:** [June 1, 2022, 10:55am UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/12 "2022-06-01T10:55:09Z")

</div>

Hi Pedro,

I agree there are some use-cases where a null does have a practical meaning, when translated to a zero, that’s why we have the default operator. However, the problem in this case is that your data do not have a null. There’s simply no data at all.

Going to the details, the thing is that we work with time-series, and we cannot know at which time should we add a zero unless there’s an event with its associated timestamp (even if the event value is null).  
Even if you are aggregating the serie into a single value (as is your case), your serie has no events at all, so there’s basically nothing, that’s not a null value.

I’m sorry but this is how metrics are intended to work. If this customer extension is reporting the number of occurrences of a given event, and they want to track occurrences of “zero” events, then they need to report those zeroes as well (or ingest a null&nbsp;event at least).

---

<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:** [June 20, 2022, 7:08am UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/13 "2022-06-20T07:08:57Z")

</div>

Hi,

Exactly same use case for me :

 ![image (18).png](https://global.discourse-cdn.com/dynatrace/original/2X/c/c4a8eb0b3b9dc73a8ab6273d5f783cc368f0625b.png)

Really annoying for custom KPIs.

---

<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:** [June 27, 2022, 6:06pm UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/14 "2022-06-27T18:06:31Z")

</div>

No data and 0 mean two completely different things.

- **No data:** means not even a single data point within the selected timeframe
- **0:** means a proper aggregation of at least one value in the selected timeframe.

So “-” actually shows that there was no data or that any arithmetic operation would not have made sense.&nbsp;Nevertheless, I agree that for expressions it would be handy to be able to define “neutral” operations. E.g., when Dimension a = 220 and Dimension b = “-”…

But for the record - What would you expect, for example, when doing the following simple arithmetic operations:

- a + b = ?
- a \* b = ?
- a / b = ?
- a - b = ?

---

<div class="post-metadata">

**Author:** ![DavidFearns](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@DavidFearns](https://community.dynatrace.com/u/DavidFearns)\
**Post date:** [June 28, 2022, 6:28pm UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/15 "2022-06-28T18:28:45Z")

</div>

If a = 220 and b= “-” (or zero) then I would want to see the below results:

- a + b = 220
- a \* b = 0
- a / b = Error
- a - b = 220

and to give an example of a success rate I use in my charts:

(success count/(success count+failure count))\*100 = success rate

so if sc = 220 and fc = 0 then:

(220/(220+0))\*100 = 100% success rate.

Currently with the ‘No data’ result this happens:

(220/(220+No data))\*100 = Error

---

<div class="post-metadata">

**Author:** ![arora138](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@arora138](https://community.dynatrace.com/u/arora138)\
**Post date:** [September 15, 2022, 5:27pm UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/16 "2022-09-15T17:27:13Z")

</div>

Hi Enrique,

I also am getting no data, but it’s a builtin metric,&nbsp;builtin:kubernetes.pods with a dimensional filter to include only Pending pods. This metric should return to 0 if there’s no pods but it only displays data when it’s not 0. This makes it difficult to use it for equations of taking the number of desired pods - ready pods - pending pods.

If there are no pending pods, I assume the data should be null, but default(0) seems not to be working. Any insights would be very helpful. 🙂 Also if it is not getting data in and therefore there are no null values, could you explain why that’s the case for this metric. Seems something to always be reporting on.

---

<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 19, 2022, 3:20pm UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/17 "2022-09-19T15:20:40Z")

</div>

Thank you a lot&nbsp;[@DavidFearns](https://community.dynatrace.com/user/43197)

Have you tried applying **":default(0)**" to your metrics in all the “-” cases? Given that there was at least 1 single data point reported in the timeframe selected, it should then make a dash to a value or 0. This also helps to calculate the value. Find more about it under “ **Replacing missing values like a bo$$** ” here:&nbsp;[https://community.dynatrace.com/t5/Dashboarding/Dashboard-Data-explorer-tips/m-p/179979](https://community.dynatrace.com/post/179979)

In the case no data was reported within the timeframe, we, the dashboarding/Data explorer team. can’t do a lot here other than allowing for different representations, Therefore in such cases I have to&nbsp; forward you to my colleagues at the metrics team.&nbsp;[@fcourbon](https://community.dynatrace.com/user/52880)&nbsp;promised to have a look at it, whether also in such cases can provide a true default value that is then used in calculations.

regards

---

<div class="post-metadata">

**Author:** ![DavidFearns](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@DavidFearns](https://community.dynatrace.com/u/DavidFearns)\
**Post date:** [September 26, 2022, 2:58pm UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/18 "2022-09-26T14:58:07Z")

</div>

Hi, by using :default(0) it provides an incorrect answer to the calculation,&nbsp;[@fcourbon](https://community.dynatrace.com/user/52880)&nbsp;can you help please?

It seems very inconsistent as for some of my metrics where there are no requests within the same time period the result shows as ‘0’, but for some others it shows as ‘No Data’.

Thanks,

Dave

---

<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 26, 2022, 3:04pm UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/19 "2022-09-26T15:04:28Z")

</div>

I believe, please check this by switching to a “line chart” for a given metric, because for these metrics with 0 you actually ingest numbers. Probably 0 or near 0&nbsp;then then is averaged to 0 and therefore folded (aggregation over all datapoints in the selected timeframe to a single one) to 0.

This means when in the selected timeframe for the table you switch to a line chart you should see..

- **no data** : if there truly&nbsp;were no data points reported/ingested, or
- **dots or a line** if&nbsp;any data point was reported within the time frame
  - **dots** if “connect gaps” is disabled
  - a **line** if “connect gaps” is enabled

pls&nbsp;[@fcourbon](https://community.dynatrace.com/user/52880)&nbsp;chime in if any correction to this is needed.

---

<div class="post-metadata">

**Author:** ![DavidFearns](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@DavidFearns](https://community.dynatrace.com/u/DavidFearns)\
**Post date:** [September 26, 2022, 3:10pm UTC](https://community.dynatrace.com/t/replace-no-data-with-0-in-a-dashboard/34063/20 "2022-09-26T15:10:30Z")

</div>

Hi, it works fine for line graphs but I need to use the ‘Single value’ option to show a success rate

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