Hello community,
I'm using this code in the Items property of a Gallery:
With(
{
wList:
Filter(Sort(GroupBy('Challenge Leaderboard',"Title","DistinctRecords"),Sum(DistinctRecords,Points),SortOrder.Descending), Sum(DistinctRecords, Points) >= LeaderboardMinimum)
},
ForAll(
Sequence(CountRows(wList)),
Patch(
Index(
wList,
Value
),
{RowNo: Value}
)
)
)
My SPO List has 4 columns ("Title" --> string column with user email, "Player" --> person-type column, "Week" --> choice column that can take Week 1, Week 2, Week 3, Week 4 values and "Score" --> number column, the score of each player for each week.
Using this Items property code, I can then have my gallery display the total score for each player (i.e. the sum of his weekly scores) and an index (called RowNo) that is 1 for the first row, 2 for the second row, 3 for the third row in the gallery and moving on...
As a result, I have a gallery that looks like:
1. Paul --> 30 points
2. Marco --> 30 points
3. Andrew --> 25 points
4. Natalie --> 20 points
5. Georgia --> 20 points
etc.
I want to somehow update this code so that the row index is the same for people with the same sum of points i.e.
1. Paul --> 30 points
1. Marco --> 30 points
2. Andrew --> 25 points
3. Natalie --> 20 points
3. Georgia --> 20 points
any thoughts?