Summation of numbers from the database collection

Hey.
I have member data in the database collection. I need that on the page “Results of participants” when entering the name of the participant in the search engine, in the column “Points” the total number of points of this participant is displayed.
How to do it?


An example of what I want to achieve

You need to connect the dataset to the elements on your search page

@poolshark314 I know how to connect a dataset, I know how to make a search bar. I need to show in the column on the result page the total number of “Points” cells for one person, for example John Blake.
For example, a person worked for 1 week and scored different points on different days. By the end of the week, on the results page, I enter the name of the person and see how many people have scored “points” in a week.
This is what I need.

@umar1987 If your dataset is connected and your search is working correctly, then all you need to do is connect the textbox to the search results and return the points field.

@poolshark314 It looks like you don’t understand what I’m talking about. I connected the “results page” to the data set, I set up a search field, connected all 3 text fields to the corresponding cells in the database collection. He does not give out all the points that a person has. For example, John Blake scored 4 points on Monday, on Thursday he scored 2 points, and at the moment the “results page” gives out only one variant of these two. I need that when I typed the name John Blake in the search engine, the number 6 was displayed in the “Points” column. The system should add 4 + 2 numbers and in the “result page” there were 6 in the end.

@umar1987 Ok, that I believe would be an afterquery calculated field. I have been having trouble using calculated fields myself so i’m afraid I won’t be much help with that

1 Like

@poolshark314 Yes, this is what I need. But, since I don’t understand anything in the code, I’ll have to work on it.
Thanks you.

Have a look at the aggregate function from wix-data. I believe it has the capabilities you need

Yes, I looked, the codes for me are a little complicated thing, since I have never done this before. I will first do the guide, and then try to solve my problem.

Anyone who can help with the code would be very grateful.