Title
Newbie Question about Groups and sums
Post
Hi to all,
I am total newbie on this so sorry for the stupid question.
In my struggle to understand filemaker i have the following scenario
I have a table with the following records and fields
............field1...........field2
rec1.....1/1/2014.........3
rec2.....1/1/2014........5
rec3....3/3/2014........12
I need to create another table that i keep the grouped sums of the above table and updated every time a new rec created.
like..
rec1.......1/1/2014.....8
rec2.......3/3/2014....12
similar the sql command select field1,sum(field2) from table GROUP BY field1
How can i do this?
It's quite possible that you do not need the second table at all. You can generate a summary report with one row of data for every unique value of Field1 with a sub total placed next to it. See this thread for a tutorial on summary reports: Creating Filemaker Pro summary reports--Tutorial
But you can also define a table where field 1 is the date shown and used as a match field to set up a relationship in Manage | database | relationships linking the two tables by date:
Table1::DateField = Table2::DateField
Then Table2::field2 can be defined as a calculation field: Sum ( Table1::Field2 ) to compute the total.
It is also possible to set up calculation fields that use ExecuteSQL to compute such a an aggregate value.