# Specify 7 and multiple table aggregators in queries

**URL:** <https://speciforum.org/t/specify-7-and-multiple-table-aggregators-in-queries/1604>\
**Category:** Get Help\
**Created:** [March 6, 2024, 4:44pm UTC](https://speciforum.org/t/specify-7-and-multiple-table-aggregators-in-queries/1604 "2024-03-06T16:44:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![twilson](https://avatars.discourse-cdn.com/v4/letter/t/2bfe46/32.png) [@twilson](https://speciforum.org/u/twilson)\
**Post date:** [March 6, 2024, 4:44pm UTC](https://speciforum.org/t/specify-7-and-multiple-table-aggregators-in-queries/1604/1 "2024-03-06T16:44:32Z")

</div>

Several of our collections have multiple table aggregators assigned to various tables. We use these in the label and reports, most importantly. When I run a query in Specify 7 the first one defined in the DataObjectFormatter xml for that table, is always used, even if it is not the default. In Specify 6, the way we set a non-default aggregator in a query, was to export it, modify the ‘formatName’ attribute of the xml node for that field, then re-import the query. When I try the same thing in the json of an exported query, then re-import it, it ignores the change and the first aggregator defined in the DataObjectFormatter is still used. I have found a workaround by just moving the default aggregator in the DataObjectFormatter to be the first in order, but would like to know if there is a way to assign other aggregators to aggregated query fields. I don’t seem to figure out a way to do that, or maybe I’m ignoring something.

---

<div class="post-metadata">

**Author:** ![Grant](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/grant/32/4255_2.png) [@Grant](https://speciforum.org/u/Grant)\
**Post date:** [March 12, 2024, 8:49pm UTC](https://speciforum.org/t/specify-7-and-multiple-table-aggregators-in-queries/1604/2 "2024-03-12T20:49:50Z")

</div>

Hi @twilson,

Thank you for reaching out to us about this issue with multiple table aggregators in Specify 7. I understand that you are experiencing some difficulties with setting a non-default aggregator in a query.

Interestingly enough, one of our developers identified the same issue issue just a day after your message (we are engineering a visual interface for customizing table formats and table aggregations now). He created an issue on GitHub here:

> <https://github.com/specify/specify7/issues/4614>
>
> \*\*Describe the bug\*\*
> I created a new DataObjFormatter, set is as "The Default T…able Formatter", and save it. I then went to the query builder and re-ran the query, but the same aggregator was being used. It didn't switch over to using the new default aggregator until I deleted the old one.
> 
> I tried doing this again, and when I created the new formatter and checked it as default at the sametime, the change was reflected when rerunning the query. But, then when I went to switch the default formatter back to the original (and pressed save), the change was not reflected when rerunning the query.
> 
> The DataObjFormatter UI seems to reflect the default formatter has been changed, but I suppose the default value might not be updated in the database.
> 
> \*\*To Reproduce\*\*
> Steps to reproduce the behavior:
> 
> 0. Tested on edge with the sp7demofish\_2\_9\_24 database
> 1. Go to App Resources -\> Record Formatters -\> Collector -\> Add
> 2. Press the "Save" button.
> 3. Create a "Collecting Event" query, and select "Collectors -\> aggregated"
> 4. Try switching the default table formatter between the two (make sure to press Save), and see that when a new query runs, the field formatting in the query results remains unchanged.
> 
> \*\*Expected behavior\*\*
> The fields in the query builder should be using the updated default formatting.
> 
> \*\*Screenshots\*\*
> !\[image\](https://github.com/specify/specify7/assets/2774057/5448ee73-9002-4936-b6d4-bcd7ee8a50f5)
> !\[image\](https://github.com/specify/specify7/assets/2774057/9e140bdc-dc1e-4d95-9fb1-72ab259b4379)
> !\[image\](https://github.com/specify/specify7/assets/2774057/341cb1a2-3ff7-4d8a-9a9e-30956930d1f5)
> !\[image\](https://github.com/specify/specify7/assets/2774057/3a906392-576e-471a-8afc-7b5160648e45)
> !\[image\](https://github.com/specify/specify7/assets/2774057/7fe5b42f-5f61-4386-8fed-77c64604147e)
> 
> Alternatively, please fill out the following information manually:
> 
> \- Specify 7 Version: edge (7.9.4 pre-release, after xml-editor merge)
> \- Database Name: sp7demofish\_2\_9\_24
> \- Collection name: KU Fish Voucher

At this time, Specify does not currently support assigning a specific table aggregation to an `(aggregated)` query field, but it will be included in the next Specify update (7.9.4)!

In the meantime, your workaround of rearranging the default aggregator in the DataObjectFormatter is workable as a temporary solution. I apologize for any inconvenience this may have caused and please let me know if there is anything else I can assist you with.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/1/18a843c97bc32b40e8ad0e035755bc88ffaacaf7.svg) [@system](https://speciforum.org/u/system)\
**Post date:** [July 17, 2025, 5:17pm UTC](https://speciforum.org/t/specify-7-and-multiple-table-aggregators-in-queries/1604/3 "2025-07-17T17:17:17Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
