# Aggregate only working in last leading subsummary

**URL:** <https://forum.servoy.com/t/aggregate-only-working-in-last-leading-subsummary/6748>\
**Category:** Classic Servoy\
**Created:** [November 15, 2006, 2:43am UTC](https://forum.servoy.com/t/aggregate-only-working-in-last-leading-subsummary/6748 "2006-11-15T02:43:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SteveInLA](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@SteveInLA](https://forum.servoy.com/u/SteveInLA)\
**Post date:** [November 15, 2006, 2:43am UTC](https://forum.servoy.com/t/aggregate-only-working-in-last-leading-subsummary/6748/1 "2006-11-15T02:43:52Z")

</div>

I am designing reports for my solution and finding that an aggregate is not behaving as expected. I have tested this on the orders table of the example\_data database. I would like to have a report that groups data first by customer, then by employee, then by orderdate and shows a count of records for each grouping. I create a form with a leading subsummary for each group and place the same aggregate field (a count of the orderid column) in each subsummary. In 2.2.5, I sort the records in the order of the subsummaries and what I find is that the aggregate only shows the count for the last group in the sort and shows 1 for all the preceding subsummaries. In 3.0.1, the aggregate only works if there is only 1 leading subsummary.

Is this a Servoy limitation? If so, is there a workaround? HTML is not an option in this case until the 70-page limit problem is addressed.

Steve In LA

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [November 22, 2006, 1:15pm UTC](https://forum.servoy.com/t/aggregate-only-working-in-last-leading-subsummary/6748/2 "2006-11-22T13:15:49Z")

</div>

We are unable to reproduce this, could you please create a support case at: [http://crm.servoy.com/servoy-webclient/ … oy\_support](http://crm.servoy.com/servoy-webclient/solutions/solution/servoy_support)

---

<div class="post-metadata">

**Author:** ![SteveInLA](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@SteveInLA](https://forum.servoy.com/u/SteveInLA)\
**Post date:** [November 27, 2006, 7:01pm UTC](https://forum.servoy.com/t/aggregate-only-working-in-last-leading-subsummary/6748/3 "2006-11-27T19:01:26Z")

</div>

I have submitted a sample solution to the Support System. In creating it, I discovered that the problem only occurs if the aggregate value is shown in a label only. If a field for the aggregate is placed within the subsummary, then the aggregate value is correct in both the field and the label. I can use this as a workaround, but I lose the flexibiliy of being able to display the data in a label, such as if I wanted the value to appear in the middle of a sentence (i.e. “There are %%aggregate\_value%% orders for customer %%customer\_name%%.”).

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [December 20, 2006, 9:05pm UTC](https://forum.servoy.com/t/aggregate-only-working-in-last-leading-subsummary/6748/4 "2006-12-20T21:05:07Z")

</div>

We found and fixed the issue, it will be corrected in Servoy 3.1 rc1 (to be expected tomorrow)  
Thanks for sending in a sample solution!
