Looks like getSummary is what you need here, but you need to specify the right type of summary field and the correct break field: Structure Type and sort your records by that field.
I don't understand your expected results.
The minimum hours for structure type K would be 8, the maximum (which is not the same as the total) would be 30
For type V, it would be 15 and 55 respectively.
Thanks for the response Phil. I don't think I explained the question properly the first time. I added additional information to the question and reposted it. Thanks.
Thanks for the update. I held off on specifics until I could see the actual results you wanted.
You have two different ways to use a summary field to get the sub totals you want.
You can construct a summary report with sub summary parts and you can then place total, maximum, average and minimum summary fields in these sub summary parts. You can include the individual records under or above each sub total entry, or you can delete the body part and just have the sub totals be visible.
You can also use calculations with the getSummary function to compute the sub totals.
To compute the total hours for a given structure ID:
Define a summary field sTotalHours as the Total of your hours field.
Define a calculation field, cTotalHoursStructureID, as GetSummary ( sTotalHours; StructureID )
This field will return the desired sub total when it is placed in the body of your layout or in the sub summary part, provided you sort your records by StructureID.
To get your type subtotals, define two more fields. sMinHours as the Minimum of cTotalHoursStrutureID. Then GetSummary ( sMinHours ; StructureType ) will return the minium subtotal for a given structure type.
These calculations depend on sorting the found set correctly. They should be sorted first by structureType, then structureID.
Thanks for the response, Phil. You were a great help. I have been working on this all morning. I now have the min, max and average working. However, using the same method, I can not get the count of structures working.
It might be obvious to you what I'm doing wrong. Any help is appreciated.
K Count = 2
V Count = 3
Wow it worked! Thank you very much :)