How to get NO DATA to 0 when there is no data value

Hey all,
hope all is well !

Have a question regarding the possibility of being able to change NO DATA to 0 (zero) in a visolation to a warehouse in Sweden. Today, when our truck drivers look at a queue in Grafana that has no assignments, it says NO DATA. The idea is to have 0 (zero) instead. Does anyone in this society have a solution to this?

with kind regards,
GurraG

1 Like

Welcome @gurrag
What kind of visualization plugin is this for?

try value mapping:

grafana 9
image

6 Likes

image

@valdemarpavesi1 Hello valdemarpavesi1, I’m using grafana 9 and followed your solution to change the "no data " to “good”.
no-data

The visualization plugin I used is table. As the following capture, it successfully showed “good”. But when I want to change the background color or the color of the text “good”, I tried and googled lots of webpages, and doesn’t find the way to change the background color or the color to text “good”.
table

I also tried the value mapping, it doesn’t work to map the special “empty” or “null” to the text “good” that I wanted.

Could you share the configuration about the color setting?
Looking forward to your reply.
Thanks in advance.

1 Like

If you want to have a zero when a time series is showing no data, you can add or vector(0) at the end of your query. After that, you can even do a mapping to that value if you want to express better what it means, specially when 0 means OK/Healthy/etc. I have used it for status report and it works perfect!

2 Likes

adding vector(0) worked for me. Thanks

where should i insert that “vector(0)” code? srry

1 Like


For me this doesn’t work unfortunately

2 Likes

@vasquezlricardo I have the same requirement to show no data value to zero with color backgroud, but I am using Logic monitor rest API url for the data with infinity plugin datasource, so adding vector(0) is not working. You have any idea, on how can I achieve this with Rest API source?

for situatinon when we got null or nan we need to use:
or on () vector (0)