Replace N/A values with 0 in indicators

Comments

5 comments

  • Avatar
    Robert Vaughan

    This script works great for an indicator with a single value,  when you add a secondary value is displays a blank.   Does anyone know how to handle this result i.e. when there is a secondary values on the indicator that is not null?

    1
    Comment actions Permalink
  • Avatar
    Jessica Orlando

    It seems this script broke in 8.1.1 and the 0 no longer shows up, just the label of the indicator.

    0
    Comment actions Permalink
  • Avatar
    Ben Sadan (Edited )

    Hi Robert Vaughan and Jessica Orlando

    replace the code you have with this, it will fix both of these problems!

    widget.on('render', function (w, q) {
    if(w.queryResult.value.text == "")
    {
    w.queryResult.value.data = 0;
    w.queryResult.value.text = 0;
    }

    if(w.queryResult.secondary != null && w.queryResult.secondary.text == "")
    {
    w.queryResult.secondary.data = 0;
    w.queryResult.secondary.text = 0;
    }
    })
    0
    Comment actions Permalink
  • Avatar
    Jessica Orlando

    Thanks Ben!

    0
    Comment actions Permalink
  • Avatar
    Brian Wilson

    Thank you, Ben!

    0
    Comment actions Permalink

Please sign in to leave a comment.