Forum Discussion

PhoenixRainBird's avatar
PhoenixRainBird
Community Member
3 years ago

NaN issues, blank entry fields, broken variables. I'm so lost!

I have a behavior tracking program where users set their goals and log their behaviors. 4 behaviors are in one category and 2 behaviors are in another and users can see their progress in a lightbox after each time they submit their log.

The top 4 behaviors should add to the ReadinessSupportTotal variable each time a user submits their log but it keeps giving me a NaN. The bottom 2 behaviors that add to the ReadinessResponseTotal variable work just fine even though they should all work the same way. 

And the reducing stigma field is the only one without a zero. It happens even if I put a new input field there. 

Is my project haunted? The tracking goes on for 10 days so there are a lot of variables to deal with.  Please help!

  • Unfortunately that didn't fix it but definitely a solution worth keeping in mind for the future!

    • SteveGannon's avatar
      SteveGannon
      Community Member

      See the revised file attached.

      1. As Joseph suggested, I initiated RS_RSDay01 to 0 using a trigger on the Day 1 Tracking slide and that populated the corresponding numeric entry box with 0 (though I agree that shouldn't be necessary).

      2. I believe the variable used in the second trigger on the Progress Meter slide was incorrect. It should be dividing by ReadinessSupportGoal, not ReadinessSupportTotal, correct?

      3. For the two triggers that perform division on the Progress Meter slide, I added a condition to only perform the operation if the variable being divided by is greater than 0. The NaN ("not a number") display typically occurs when you divide by 0 (resulting in infinity).

  • I can't believe that worked!! I misunderstood Joseph's suggestion and populated the ReadinessSupportTotal with a 0 at the beginning. Somehow only initiating the RS_RSDay01 trigger on day 1 fixed it for all the other days as well!

     

    Good catch on the progress meter math. It looked off but I was too focused on the support total issue to realize it. Thank you both!