# Show “null” or replace with a value in a field

**URL:** <https://community.dynatrace.com/t/show-null-or-replace-with-a-value-in-a-field/45901>\
**Category:** Dashboarding\
**Tags:** dashboards\
**Created:** [June 4, 2024, 7:55am UTC](https://community.dynatrace.com/t/show-null-or-replace-with-a-value-in-a-field/45901 "2024-06-04T07:55:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Red](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/red/32/14895_2.png) [@Red](https://community.dynatrace.com/u/Red)\
**Post date:** [June 4, 2024, 7:55am UTC](https://community.dynatrace.com/t/show-null-or-replace-with-a-value-in-a-field/45901/1 "2024-06-04T07:55:17Z")

</div>

Hello community,

I am in the process of discovering DQL but I am encountering a rather serious problem: I have several filters for a table in my dashboard which are populated with the values ​​of the table. This part works fine but one of my columns may have “null” values. And in my filter, this is not seen, and biases my results.

In the screen below, you can see that I use several filters, with success, but the “Management\_Zones” filter does not show all the possibilities because of the “nulls” that may be found there. I did the calculation with and without filter and the difference is significant :

 ![Red_0-1717487686257.png](https://global.discourse-cdn.com/dynatrace/original/2X/1/123dd0cf5d8c430f62cd617535a8a321946950da.png)

My question is the following: how can we force “nulls” to be named in a specific column? I looked for several solutions but all the ones I tested didn’t work.

Sincerely,

Red

---

<div class="post-metadata">

**Author:** ![joeistyping](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/joeistyping/32/26040_2.png) [@joeistyping](https://community.dynatrace.com/u/joeistyping)\
**Post date:** [June 4, 2024, 9:15pm UTC](https://community.dynatrace.com/t/show-null-or-replace-with-a-value-in-a-field/45901/2 "2024-06-04T21:15:41Z")

</div>

Hey Red! (I’m team Poke Yellow way back in the day)

My recommendation to force a value is by using expressions to replace null with “some value”, in the below example, this DQL expressions updates the field “managementZones” with the value “No\_MZ”, if the current value is null.

This will need to be updated within your variable definitions within your dashboard and within your tiles.

```ruby
| fieldsAdd managementZones = if(isNull(managementZones), "No_MZ", else:managementZones)

```

Full example:

Variable Definitions:

```ruby
fetch dt.entity.host
| fieldsAdd monitoringMode, osType, osVersion, hostGroupName, managementZones
| summarize takeLast(id), by: {managementZones}
| fields values = managementZones
| fieldsAdd values = if(isNull(values), "No_MZ", else:values)

```

Tiles:

```ruby
fetch dt.entity.host
| fieldsAdd monitoringMode, osType, osVersion, hostGroupName, managementZones
| fieldsAdd managementZones = if(isNull(managementZones), "No_MZ", else:managementZones)
| filter in(managementZones,$ManagementZone)
| summarize count = count()

```

Result when we select all MZ’s and also select “No\_MZs”:

 ![joeistyping_0-1717535390469.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/e/9e537f4a5022f148aa60b4867aab8aa9c9513f8c.png)

Cheers,

---

<div class="post-metadata">

**Author:** ![Red](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/red/32/14895_2.png) [@Red](https://community.dynatrace.com/u/Red)\
**Post date:** [June 7, 2024, 12:26pm UTC](https://community.dynatrace.com/t/show-null-or-replace-with-a-value-in-a-field/45901/3 "2024-06-07T12:26:13Z")

</div>

Hi joeistyping (good choice on the Yellow team ^^)

I just came back from leave and I tested your method, it works perfectly!

Thank you very much for your help !

Red
