From the context of your layout, the summary fields show totals based on the group of records displayed in your total. When you define your calculation, the table in which you define the calculation field and the context you select for it in the context drop down found in specify calculation determine how the totals calculate. In addition, if your portals are filtered, this affects the totals shown in any summary field displayed inside the portal, but the filter has no effect on the total computed in the calculation field.
So in what table did you define this calculation? What context did you select from the context menu?
Or is it a step in a script?
And two portals side by side indicates that you have three table occurrences linked in two relatioships--one for each portal. What relationships have you set up?
Ah sounds difficult to me at first but I think I get it after reading it a few times (-:
However, Im not able to resolve it by myself, here's more info:
The DB exists of 25 tables in total, where only the following three matter for this question:
- Properties (with __pkPropertyID)
- Monthly Financials (with _fkPropertyID)
- Property taxes (with _fkPropertyID)
- They are linked trough their pk's and fk's. and set up to create and delete records in table 2 & 3 trough this relationship.
- Tables 2 & 3 appear in separate portals on a layout based on table 1 (a property).
I think this clarifies your question towards me? please let me know if you need anything else! Thanks Phil! Really appreciate your help as usual!
A calculation field defined in Properties with Properties selected in the Context menu at the top of Specify Calculation dialog should then compute the correct result with one of the following two options:
Monthly Financials::Total NOI - Property Taxes::Total
or you can use:
Sum ( Monthly Financials::FieldSummedBYTotal NOI here ) - Sum ( Property Taxes::FieldSummedByTotalHere )
But both of these calculations assume that you are not filtering your portal with a portal filter expression as they directly access the related data without any interaction with your portals. (You could delete the portals from your layout and these calculations would still evaluate the same.)
So if you are using a filtered portal, you will have to use a different calculation that replicates the "logic" of your portal filter expression.