Replace N/A values with 0 in indicators

Comments

6 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
  • Avatar
    Paul Furman

    Hi, Ben Sadan!

    Thank you very much for the code!

    This code does not work for me, unfortunately.   My primary value is a basic DUPCOUNT; however, the secondary one is PASTMONTH of it.

    Both are 0 and it displays as such for the primary; however, still displays #N/A for the secondary.

    Any help would be appreciated!

     

    0
    Comment actions Permalink

Please sign in to leave a comment.