Skip to content

Last (aggregated) field in the query defines the table aggregation for the entire query #5164

@grantfitzsimmons

Description

@grantfitzsimmons

Describe the bug
The last (aggregated) field in a query defines the table aggregation separator for all (aggregated) fields in the query.

To Reproduce
Steps to reproduce the behavior:

  1. Build a query with multiple (aggregated) fields
  2. See that the Table Aggregation for the last query item (last (aggregated) line in the query definition) defines which separator is used for all other aggregated records

You can use this query and change the order of the aggregated query lines for reference:
https://kufish212-v796.test.specifysystems.org/specify/query/185/

Expected behavior
The Table Aggregation should be respected.

Screenshots

When Preparations comes first in the query

image

When Determinations comes first in the query

image

Crash Report
v7.9.6.2 on kufish_2_12 on the test panel. spfishadmin is the username.
Arc, macOS

Specify 7 System Information - 2024-07-30T14_15_24.010Z.txt

Reported By
CSIRO on Asana

We just stumbled across this issue which only appears in S7; the query out put in S6 is correct.

We noticed that when there is more than one aggregated view of a table present in a query, that the separator of the last aggregator is forced onto all aggregations.
 
Here is an example. The separators for the two tables preparation and Traits (collectionobjectproperty) are different.

image

When the query contains the aggregators in the order Preparations > Traits, the resulting aggregation for both fields has the separator from the Traits (|)

image

When the query contains the aggregators in the order Traits > Preparations, the resulting aggregation for both fields has the separator from the Preparations (;)

image

When the same query is executed in S6, each field displays with their defined separator.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    1 - BugIncorrect behavior of the product2 - QueriesIssues that are related to the query builder or queries in general3 - VerifiedIf an institution makes a request and it has been confirmed to be accurate, this tag will be used.

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions