I’m new to glide and building an app for a golf tournament. So far I have a table for the course handicap, the players, the teams and a scorecard that logs each players score per hole. I’m trying to display the combined team score on the “Team” page, I cannot for the life of me get it to roll the player scores into one total team score. I have relations all over the place, look ups, etc. I must just be missing a piece. Any ideas?
Can you expand on this? What results are you getting? Can you share some screenshots of the data and what you have tried?
Absolutely. The results I’m getting show one row for each player on the team for each hole. What I’d like is one row for the team with the total score of the two players combined.
I have a table of players, a table of teams, a score card that logs the scores per player as entered into the app via a form. I have the both the players and teams tables related to the score card and to each other.
This is the scorecard table with the relations. I’ve tried roll ups, arrays, look ups, I can’t seem to get it to pull the right way when displayed. I also have the Top 9 scores pulled into an array, then sorted, then sliced - I also can’t figure out how to sum those top 9 scores.
For your top 9 array you could do that with a helper table.
-
Create a new table and add a row Id
-
Add a lookup column and target the row id
-
Add a find element index and take the values from the lookup column and find the row id
-
Add a single value column and target your top 9 array
-
Add another single value column and Get ‘from start’ Row ‘YOUR FIND ELEMENT INDEX’ From: single value top 9 array
have at least 9 rows in your helper table and then you could roll it up.
How do you define “top 9” in your database?
Have you got the “team score” part?
@ThinhDinh Right now I used a look up to return all team scores, then I created an array, sorted the array and sliced the sorted array for only the first 9.
Yes 2 single value columns. First one targets the array… let’s call it “target array”.
The second one will look at “target array”
Set the second one up like this… Get: ‘from start’ Row: ‘YOUR FIND ELEMENT INDEX’ From: ‘target array’
@Eric_Penn and @ThinhDinh while I have my top 9 figured out from if-then’s and roll ups. I’m wondering if you wouldn’t mind sharing some thoughts on best practice data structure for a Tournament - Teams - Players scenario. In my example I’m working on a golf app. Was taking the approach of Tournaments have teams, teams have players - where I run into issues is scores - both players and teams have scores. Which is causing the issue of two rows per team when I display a scorecard.
I assume you only want to display a row per team?
- Create a rowID column.
- Create a template to join the “hole” number, the “team” number (assuming you also have that as an identifier) and the “tournament” number/ID.
- Create a single relation from that template column to itself.
- Use a lookup column to return the rowID from that relation. That should give you the first “row” of every combination of hole - team - tournament.
- Filter the list of score cards by “rowID” is “lookup column” value above.
If you only need team - tournament, then eliminate the hole from the template.
Ideally I want
Hole| Player| Player
Can’t seem to get there. I have a tournament table, teams table, players table and score table (this enters scores by players which relates to team)
I’m not sure what you mean by Hole| Player| Player. Can you clarify more on this? Why are there two “Player” columns?
There are 2 players per team, I want to display a table that can be edited so users may input the score on each hole, for each player on the team.
I think a better structure for the records table would be.
Tournament ID | Hole Number | Player ID | Score
From a combination of tournament ID & player ID (assume a player can play in multiple tournaments), you would be able to create a relation and lookup combo to get the team ID.