The break field ( Type or Leads::Zipcode ) has to be part of the current sort order.
If you have sorted your records by Leads::Zipcode, then I would expect the calculation to work and I would expect no value returned if Leads::Zipcode is not part of the current sort order.
Yeah, that's what I was thinking too but here's the two fields (unless I am off somewhere) where the sorting happens:
The sub-summary line sorting by Leads::Zipcode
The "Sort Records" line in the script that's sorting by Leads::Zipcode
Here's the second image.
What version of FIleMaker and on what Operating System?
I want to run a few tests on a sample file to see if I can reproduce this and see if I can, see if more than one version has the same behavior...
One workaround that you can try, to see if it works, is to define a calcualtion field in your other table that simply copies the zipcode field from leads and then use it in both your sort order and your getSummary calculation.
OS: Windows 7
FM Version: 12.0v2
Yeah, I am thinking the same in regards to making a Zipcode field in the Appointments table and adding a relationship to replicate the zips from the Leads table. Since it's a huge database (more than 600,000 records) I was trying to avoid doing this.
I recommend that you upgrade to 12.03 as it fixes a number of issues, but it won't affect this one.
I just checked the help entry on GetSummary and it indicates that the field using GetSummary must be defined in the same table as the break field so this is "as designed" behavior.
Using the calculation field that I recommended, does work so you have that option as a work around.
Pleae note that all I did to create that new field was to define it as a calculation field and then dropped the field from the related table into that calculation as the sole term, then used in the getsummary calculation and included it in my sort order.
I have created the following field to test this. I am also changing the sorting to pull from that field instead of the same field in the Leads table. I have to wait a few to submit the changes but I'll let you know if that works.
Confirmed fix! May I recommend future versions don't allow the Table::Field as part of the GetSummary command?