# Calculate Total based on ID

Question asked by BrooksLeisure on Mar 18, 2014
Latest reply on Mar 18, 2014 by BrooksLeisure

### Title

Calculate Total based on ID

### Post

Hi,

I am using Filemaker Pro 12 Advanced.

I have a table called 'Info' with four fields; ID, Number, Total, Twenty Percent.

I want the 'Total' field to calculate the total of the 'Number' field based on the 'ID' and then I need 20% of that total

I understand that I could get the total by ID using a summary field but I need to reference these fields on another related table and I cant seem to do that with a summary field.

For example:

Record 1: ID = 1  Number = 100 Total = 400 Twenty Percent = 80

Record 2: ID = 1 Number = 50 Total = 400 Twenty Percent = 80

Record 3: ID = 1 Number = 250 Total = 400 Twenty Percent = 80

Record 4: ID = 2  Number = 60 Total = 240 Twenty Percent = 48

Record 5: ID = 2 Number = 30 Total = 240 Twenty Percent = 48

Record 6: ID = 2 Number = 150 Total = 240 Twenty Percent = 48

ect...

I have tried:

Case(ID = "1" ; Sum(Number) ; ID = "2" ; Sum(Number))

but this doesn't seem to work, it just shows each records 'number' in the total field

I hope that makes sense and thank you in advance for any help