Adding values from 1 field and showing a total in another field.

Tap Forms Database Pro for Mac, iPhone, iPad and Apple Watch Forums Using Tap Forms 5 Adding values from 1 field and showing a total in another field.

Viewing 2 reply threads
  • Author
    Posts
  • February 28, 2022 at 9:41 PM #46900

    Russ Dreydun
    Participant

    Hi,
    Im new to databases and to Tap Forms. I want to track my pool scores when I practice. I have a field called rack score and I have another field called Overall Total Score. I practice 10 racks at a time and want to see my total balls pocketed in the Overall Total Score Field. Pretty basic I know but I couldn’t figure it out. I don’t know how to code but I’m hoping I don’t need to for this small DB.
    Thank you for your help,
    Russ

    March 1, 2022 at 12:11 AM #46901

    Brendan
    Keymaster

    Hi Russ,

    What you can do for this is to add a Calculation field to your form and just add up all the values from the other fields that hold the scores. So instead of an editable Overall Total Score field, you would make that a Calculation field and then just add the other fields in the formula.

    For example:

    Score 1 + Score 2 + Score 3

    and so on…

    However, Tap Forms only evaluates a formula if all fields are provided a value, so to get around this, you just need to add a check to see if the value is empty. It does make the formula a bit more complicated, but it’s not that bad.

    IFEMPTY(Score 1; 0; Score 1) + IFEMPTY(Score 2; 0; Score 2) + IFEMPTY(Score 3; 0; Score 3)

    What this says is, if Score 1 is empty, return a 0 value, otherwise return the value of the Score 1 field. Now add that to the same thing for Score 2, Score 3, and so on.

    An alternative to doing this is to just set 0 as the Default Value for all your Score fields. But sometimes an empty score means something different than a 0 score, so you have to decide what’s meaningful to you.

    Hope that makes sense.

    Thanks,

    Brendan

    March 1, 2022 at 7:50 AM #46903

    Russ Dreydun
    Participant

    Thank you very much Brendan. That makes sense to me. Your support is incredible.

Viewing 2 reply threads

You must be logged in to reply to this topic.