Knowledge Base Article

Replace N/A Values With 0 In Indicators

This script replaces N/A values with 0 values. Applies for Indicator widgets.
Before:
After:

Copy the following script and place it under 'Edit Script' in the designated Indicator widget:
widget.on('render', function (w, q) { 
 if (isNaN(w.queryResult.value.data) === true)
 {
  w.queryResult.value.data = 0;
  w.queryResult.value.text = "0";
 }
 
 if(w.queryResult.secondary != null && isNaN(w.queryResult.secondary.data) === true)
 {
  w.queryResult.secondary.data = 0;
  w.queryResult.secondary.text = "0";
 }
})
Updated 03-02-2023

1 Comment