I would like to know how to SUM up all the [...

(Russey Novell) #1

I would like to know how to

SUM up all the [Points] from the same person based on [PersonID]?

Example: Table Person has a full list of information for all the people. It has a column named [Points]. I would like this column [Points] to SUM/show all the points that belong to a person. The points can be found in another table for each event this person attended.

Table Event has the points listed based on [Person ID]. One [PersonID] can be found in multiple rows and each row represents the event he attended.

Example: [PersonID] is 1234 and [Points] 10 [PersonID] is 1122 and [Points] 10 [PersonID] is 2132 and [Points] 10 [PersonID] is 1234 and [Points] 10 [PersonID] is 1234 and [Points] 10

So [PersonID] 1234 has a total of 30 [Points] and I would like this 30 points shwo on the other table.

Does my explanation make sense to you? Thank you.

(Yılmaz Kandiş) #2

Assuming that you have two tables with colums - “Person”; idPerson, PersonName, Surname, etc… - “Events”; idEvent, idPerson, EventName, Points, etc…

You may create a virtual column (may be named as [Total Points]) in your “Person” table with a formula; SUM(SELECT(Event[Points],[idPerson]=[_THISROW].[idPerson]))

(Russey Novell) #3

@Yilmaz_Kandis1 It shows me this: The ‘SUM’ function requires a list of numeric inputs

(Russey Novell) #4

@Russey_Novell My bad. let me regenerate my App. I think it might be that problem.

(Russey Novell) #5

@Yilmaz_Kandis1 It worked. Thank you. I just need to adjust a few things and it is working now with your expression. Thanks a lot.

(Aleksi Alkio) #6

May I ask are you using a related table structure?

(Russey Novell) #7

@Aleksi_Alkio I am new to AppSheet and I am not quite sure what is “related table structure” means. Could you please give me an example of related table structure? Thanks.