Count of Boolean Items/Member and display as number on site

Question:
I have a website (Wix Studio) where users/members are inputting their name, checking a box for whether they worked out, checking a box for whether they drank a gallon of water and then uploading a photo of them at the gym. Users/members receive one point for each workout and each gallon of water drank, allowing a maximum gain of 2 points per day. The data is stored in the CMS as a Boolean field. My question is what is the code to be able to display the number of points each user has earned? I am thinking it would look best in a table format. That way each user is listed with their relevant points. I was looking at the article for the ratings display (Capturing and Displaying Ratings) but that requires a number field in the CMS and I have a boolean field.

I also checked out this thread (How to count the numbers of your database (display on site) - #7 by debugslife) but I’m not sure how to query for boolean fields instead of numbers/text.

I would love if it could also rank the users/members in descending order of points.

Thanks in advance!!

EDIT: Wondering now if I can use a sum() formula…looking into this method

Nix that update…just realized sums can only be used on number fields

The logic is off.

You should have a singular profile that you update. For example Food Profile. Then have a number field for Current Points.

You would need to add code so that when they submit their “checkmarks” it calculates a number based on the amount of checkmarks being saved and then it updates their Food Profile by calculating a new number and updating into the Current Points field.

Hmmm…I see your point…okay, let me work on that. Thanks!