It's not the Sub summary layout part, it's the summary field. The value returned by a summary field depends on the context in which it is used. When you reference a summary field in a related table, you get a summary value based on the set of all related records. When you put a summary field from the layout's table in the sub summary layout part, you get a sub total based on your current found set and how your sort order groups the records.
Right - so I sort by Table B::Category and sure enough, the layout sorts by that Table B::Category.
In the Sub-Summary section, it's setup based on Table B::Category (what's being sorted) and the count value is taken from a Summary COUNT value that lives in Table B as a Summary Count Of "Category" as that's the field that's being displayed on the layout as "Table B::Category"
This is what fails.
If all fields lived in Table A, it works fine as I do successfuly have this working with a Model # that lives as a field in Table A but the second I try and engage the Summary Count on a related table, the sub-summary doesn't count.
I'm wondering if I put on my layout the related Table B fields in a PORTAL if that will somehow allow it to work.
Please read my last post. I spelled out to you how to get the needed values to appear.
Yea Phil - Sorry but I've read that and I'm pretty sure I'm doing that. Using a portal doesn't fix it btw.
Perhaps a picture is worth 1000 words. Here's all the info on setup - Again, when everything was in table-a, it works fine when sorting by a local Table-A field.
When I engage a sort with an item from Table-B that IS on this layout, the correct Category sub-summary happens correctly at every change in Category but lists the "CountOfCategory" count at always 1 leading me to believe counts of related fields do not work for some reason.
What I thought I had posted here:
Define a calculation field in Table A that computes the count of your related records in table B. This can use an aggregate function such as the count function or it can simply reference a summary field from Table B.
Set up your summary field in Table A to summarize this added calculation field. Put it in your sub summary layout part.
Whoa... that didn't work but It led the path to make it work. Thank you!
How to make it work:
You do in fact in Table A make a field called say, CountOfCategorys which is a calculation of Table B::Category
However, placing that in the Sub-summary doesn't work - it just kicks the subsummary to happen every line with the answer of one.
To get it to work:
Add another field in Table-A called CountOfCategorysNum which is a Summary field of the above CountOfCategorys and place THAT in the subsummary.
Keep everything else the same and IT WORKS!
I thought I tried this before but perhaps I had the subsummary setup wrong. However, this is pulling the relational field as that calculation into Table-A and then you can do a Summary on that as you can't choose anything but the table you're in when doing a Summary so while not a bug, a work-around.
Thanks for helping kick this around Phil!
Haha - crap - you're right - I'll have a talk with my right brain about getting too creative :)