Issue
Post updating to Pega Platform 24.2.5, a summary Report Definition with aggregate columns, such as Count, sorts results differently than it did before the update. The group-by column is assigned sort order 1, ahead of the aggregate columns.
Symptoms and Impact
- Users observe that a summary report sorts differently after an update and expect the previous ordering.
- The report is a Report Definition with aggregate columns (for example, Count) and a single group-by column.
- An earlier environment returned results that were sorted by the aggregate columns first, while Pega Platform 24.2.5 returns results sorted by the group-by column first.
- Re-entering the previous Sort order values and saving does not retain them because the values are recalculated whenever the Report Definition is saved.
Description
In Pega Platform 24.2.5, saving a summary Report Definition that has aggregate columns and exactly one group-by column recalculates the Sort order values. The group-by column moves to sort order 1, and the aggregate columns move after it, regardless of the values entered before saving.
The generated SQL changes accordingly. For example:
- Pega Platform 24.2.2: ORDER BY 2 DESC, 5 DESC, 1 ASC
- Pega Platform 24.2.5: ORDER BY 1 ASC, 2 DESC, 5 DESC
As a result, the report no longer sorts by the aggregate values first.
Steps to reproduce
- In the updated environment, open the .
- In the Edit columns section, note the Sort order values.
- Save the Report Definition and check the Sort order values again. Confirm whether the group-by column moves to sort order 1 and the aggregate columns move after it.
Explanation
This is expected platform behavior, not a regression.
For summary reports, Pega Platform gives group-by columns sort priority and places aggregate columns last so that the grouped structure of the report remains intact.
The pzPopulateSortOrder activity recalculates the sort order whenever the Report Definition is saved, so re-entering the previous values does not restore aggregate-first ordering.
Two corrections were made to the sort-order calculation:
- The aggregate-column sort-order calculation was corrected from n-1 to n.
- An off-by-one condition was corrected so that a report’s only group-by column receives first sort priority.
Before the second correction, a single group-by column could be sorted according to its stored value alongside aggregate columns, which could produce aggregate-first ordering. Environments earlier than Pega Platform 24.2.5 can therefore produce aggregate-first ordering for reports with a single group-by column, which can make the behavior after the update appear to be a regression.
Sorting aggregate columns ahead of group-by columns is not supported through Report Definition sort configuration.
Solution
Use the group-by-first sort order for summary Report Definitions.
Configure report requirements so that group-by columns receive first sort priority and aggregate columns receive last sort priority.
Sorting aggregate columns ahead of group-by columns is not supported through Report Definition sort configuration.