How to value mapping a "NaN" value?

Hi All:

I have a table column that is calculated from other columns using “Transform” -> “Add field from calculation”. The result will return NaN if the divided by Zero or the field is Null. How can I override the result? The value mapping option has no way to check for “NaN” value.

Grafana version is v7.1.0

Thanks

1 Like

Hi ,
Did you get the answer , I m facing same issue.
Value mapping on has two options for me as well.
Visualization - Stat
Value mapping has only two option - value/Range
number to text or text to number option is not coming.

Also for some calculation like 0/int Grafana is giving 0
for some 0/int it is giving NaN

Grafana - 7.3.7

I found an easy way to deal with NaN in tables, not sure if this will help you…
Starting with a table that has 2 queries (joined) showing stats for the current week (blue) against last week (green)


Go to the Value Mappings settings and add a new row:

Hit Save and all the NaN values have been swapped with lovely zeros :slight_smile:

1 Like