Summary field values shown in filtered portals are "display only". I know of no way to access the value for use in a calculation or for evaluation in a script. You'll need to figure out a relationship that matches to the correct set of records without using a portal filter to do so. This sometimes requires defining a calcualtion field that returns a constant value for use as a match field in such a relationship.
So, now I've ventured into the world of Executesql in hopes I might be able to set up the correct calculations. I saw a previous post that reccomended SQLExplorer and have tried my hand but still no luck...
the above picture is from the Class Detail Layout.. Has a filtered portal on it from the Reg Data table. I need a count of the Status from Reg Data where Status is = "Cancelled" AND.. the Reg Data::CLASS ID MATCH FIELD should also be = to Classes::CLASS ID MATCH FIELD
I worked out the following using SqlExplorer and pasted it into a field on the pictured layout. The calculation works EXCEPT I need just a count for that particular class.. Instead it gives me a count of everytime that Status is set to "Cancelled"... Which means that the AND statement I set up isn't working? It seems odd to me to have a join statement that says basically the same thing as the AND statement but I don't think I can get rid of the join?
Might you have any suggestions or could someone point me to other helpful posts? Thanks,"SELECT COUNT ( a.\"Status\")FROM \"Reg Data\" aINNER JOIN \"Classes\" b ON a.\"CLASS ID MATCH FIELD\" = b.\"CLASS ID MATCH FIELD\"WHERE a.\"Status\" = ? OR a.\"CIDMF\" = ?" ;" " ; "|*|" ;"Cancelled" ; "CIDMF (b)"
What do you get if you count on a field in b instead of a?
And what you describe here could be set up with standard FileMaker relationships to get your portals, but without a filter expression. Thus, that's an additional avenue you can persue.