Oninit Logo
The Down System Specialists
Partnerships Contact

-4385 Report aggregates cannot be nested.

Aggregate functions cannot be nested, primarily because the value of the inner aggregate is not known at the time the outer aggregate is being accumulated. Rewrite aggregate expressions to refer only to columns and simple expressions on columns. In an AFTER GROUP OF clause, you can save the aggregate value from one group of rows in a program variable, so as to use it in computing an aggregate over a subsequent group.