5 Replies Latest reply on Feb 23, 2016 1:05 AM by Zerojojo

# Related calculation from table occurrence instead of original table

You good people,

maybe I'm misunderstanding the basics of table occurrences, but here's a problem I cannot really understand: I have a table occurrence of table A related to table B, in which records are created by table occurrence A. Now I would like to do a simple calculation via the relationship, i.e. have a field on the layout based on table occurrence A that sums up the field of related records in table B. This does not work for me, because any field I have in table A sees the relationships from table A, not table occurrence A, and therefore does not see the relationship to table B. Filemaker does not even let me create the calculation, because the record used in the calculation is not related. How can I have such a calculation from a table occurrence?

I feel like I'm overlooking something really stupid or got some of the basics terribly wrong.

Thanks and best regards,

Johannes

• ###### 1. Re: Related calculation from table occurrence instead of original table

Sounds like you are trying to define the field as a Summary field. Make it a Calculation field:

Sum(tableB:amountField)

It will be unstored due to being based on related value.

• ###### 2. Re: Related calculation from table occurrence instead of original table

I do define a calculation field, but it says and shows that it is not related to table B since only the occurrence of table A is related, but not table A itself.

• ###### 3. Re: Related calculation from table occurrence instead of original table

Calculations have to evaluated from the Context of a TO, which is chosen in the calc dialogue window from a menu above the calc-writing area. Pick the correct context and the options should allow the desired related fields.

• ###### 4. Re: Related calculation from table occurrence instead of original table

Alright, now I feel really stupid overlooking that menu that has been right in front of me all the time.

Thanks so much!

• ###### 5. Re: Related calculation from table occurrence instead of original table

Is it generally advisable not to have two relationships starting from the same pk value and to  to work with a table occurrence instead or would you see no problem with that? I once heard in a youtube video that there might be certain conflicts when the same pk field has two relationships, but I could not understand the underlying problem.