Help Figuring Out a Rollup Calculation When Values in a Column Match

Here’s my scenario:

At my gym, we are doing a step challenge for the month of January. This is being done is teams of two people. Each “team” has a “team name”. Each person is entering their own steps individually each day. I have a column “total steps” (in the user table) that holds the total number of steps for each individual (it is incremented each time a user submits another value for steps). I have a column “team name” that holds the value of the team name for each user (only two users would ever have the same team name).

I’m trying to sum the values of “total steps” whenever the “team name” is the same. I think I need to do this via a RollUp or SumIf or some kind of combo, but I’m having trouble figuring it out. I’d prefer to do all of the calculations in Glide, but I can do them in my Google Sheet if needed or if it’s a lot simpler.

I will then be displaying a leaderboard that displays the team name and combined total steps for each team.

A relation linking the team name, and a rollup against the relation should work.

3 Likes

Would the relation compare the same column against itself? So where “team name” relates to “team name” inside of the same table?

Then how do I set the roll up condition to sum when the team name matches itself?

I may just need to look a this with a fresh mind and eyes in the morning.

That would only happen if you related the team name to itself in the same table. But that’s not what Jeff was suggesting.

What you need is a multiple relation column in your Users table that matches Team name with the Team Name column in your table that contains the logs. Then a rollup via that relation.

You’ll know if you have it correct, as each user in the same team should get the same result.

I don’t have a separate table with logs. I only have a column in the user table that is being incremented upon each submit. I wanted to avoid creating thousands of extra rows I don’t really need if possible. Do I have to have a separate log to accomplish this? I’ve set up things like that before so I know how to do it, but I just want to avoid the extra rows if possible.