0

Replacing NaN in ValueBox calculation

I'm looking for an easy way to replace NaN as displayed in a ValueBox when the underlying calculation is NaN. I was trying to use the Value Transform using an if statement, but have not been successful getting that to work. Anyone have an example?

3 replies

null
    • damon_vinciguerra.1
    • 1 mth ago
    • Reported - view

    You could set up a calculation that uses the If statement. It would look like 

    if([ValueBox1]='NaN','Bad',[ValueBox1])

    A "quirk" is that calculations can only reference other controls as inputs. So you'll have to put the raw tag as a ValueBox, make it invisible if you don't want it seen, then create your new ValueBox with the calculation.

    Does that help?

      • robin_haynes
      • 1 mth ago
      • Reported - view

      @Damon Vinciguerra

      Thank you, that is helpful. I will try that approach.

      • robin_haynes
      • 1 mth ago
      • Reported - view

       

      Rather than trying to use the Value Transform, I put the if statement in the Value Box Calculation like this: If(1-([ValueBox194]/[ValueBox193])=='NaN','Bad',(1-([ValueBox194]/[ValueBox193])))

      That seems to work-

Content aside

print this pagePrint this page
  • Status Answered
  • 1 mth agoLast active
  • 3Replies
  • 19Views
  • 2 Following