You will want to use the group by function. Here is a good article with an example on using it: Group BY - MatthewDevaney
I threw this code on a button to load it and apply it to his logic:
ClearCollect(myData,
{User: "John", Achievement: "A", Points: 5},
{User: "Mary", Achievement: "A", Points: 5},
{User: "Peter", Achievement: "B", Points: 2},
{User: "John", Achievement: "B", Points: 2},
{User: "Mary", Achievement: "C", Points: 6}
);
//Group by and sum
ClearCollect(
mySummedData,
DropColumns(
AddColumns(
GroupBy(myData,"User","GroupedItems"),
"Sum of Value",Sum(GroupedItems,Points)
),
"GroupedItems"
)
);
I then created 2 galleries, 1 to show the data and 1 to show the grouped/Summed data. The items for the first gallery is just the 'myData' collection from above. The grouped gallery is using:
SortByColumns(mySummedData,"Sum of Value",Descending)
This the result I get:
