Formula indicator not showing scores

acrascall
Kilo Expert

Hi All,

Using Geneva, Patch 9 in our instance.

I have a formula indicator:

( [[Number of successful changes / By month SUM +]] ) / ( [[Number of successful changes / By month SUM +]] + [[Number of failed changes / By month SUM +]] ) * 100

Which is linked to a widget, the widget details a Followed Breakdown of the Change Driver Group.   It seems when I view this widget for certain Driver Groups I cannot see any scores, transpires that I cannot see scores as there are no scores for one of the indicators. i.e. Number of failed changes

My assumption was that if there were no scores, then 0 would simply be referenced?   Don't believe this is the case though?   Any additional config required here?

pieter.goris vincentloffeld - can you help?   Perhaps a revision to my formula is required?

regards,

Andrew

1 ACCEPTED SOLUTION

acrascall
Kilo Expert

Both indicators "Number of successful changes"and "Number of failed changes" had the value for "Value when nil" as blank.



This meant that instead of the number "0" the formula was getting "nil" and as such is not able to calculate with that since it is expecting an integer. When the "Value when nil" to is set to "0" the formula was able to return a number and calculate correctly.



Thanks for everyone's help on this question. vincentloffeld arnoud


View solution in original post

9 REPLIES 9

Couldn't you change the formula into:


( [[Number of successful changes / By month SUM +]] ) / ( [[Number of closed changes / By month SUM +]] ) * 100?



Or something similar?


To return 0 when a div/0 occurs you could also use:



([[ Your Formula Indicator]]) || 0



In case of div/0 the part before the or || evaluates to false, so the right part is returned.



Before:


find_real_file.png


After:


find_real_file.png


Arnoud Kooi
ServiceNow Employee
ServiceNow Employee

In addition to my other reply, could you try:


(


        ( [[Number of successful changes / By month SUM +]] ) /


        ( ([[Number of successful changes / By month SUM +]] || 0) + ([[Number of failed changes / By month SUM +]] || 0 )) * 100


) || 0


Hi Arnoud,



I still don't see any scores for Driver Groups who don't have a failed change.  



Using the formula stated above, I have evidenced below:



Capture.PNG


acrascall
Kilo Expert

Both indicators "Number of successful changes"and "Number of failed changes" had the value for "Value when nil" as blank.



This meant that instead of the number "0" the formula was getting "nil" and as such is not able to calculate with that since it is expecting an integer. When the "Value when nil" to is set to "0" the formula was able to return a number and calculate correctly.



Thanks for everyone's help on this question. vincentloffeld arnoud