I have an APEX report and I want to have subtotals (group by column 'l_char') and Grand totals . I have achieved the subtotals by doing a page break and using the aggregate function 'add'. Subtotals_pic

Now, I also want to show the grand subtotal at the end (eg. : it should show Total = 20000 at the end of the report).

Can somebody please help and let me know how can i achieve this.

Thanks, Abha


Alternatively, if you can afford switching from interactive to classic report, then with an "ordinary" query:

select deptno, 
       ename, 
       sal
from emp
where deptno in (10, 20)
order by deptno, ename;

Set report's attributes:

  • break formatting:
    • report sum label: Total
    • break columns: first column

Set sal column's properties:

  • advanced - compute sum: set it to ON

Run the page; result is

enter image description here


It is easy to create totals using the "Actions" menu. But, grand total can't be computed that way (at least, I don't know how).

But, if you modify the query and do everything within, then you'd group by rollup and get the result.

This example is based on Scott's sample emp table; adjust it so that it contains your columns/table(s):

select deptno, 
       ename, 
       sum(sal) sumsal 
from emp
where deptno in (10, 20)
group by rollup (deptno, ename)
order by deptno, ename;

The result is then

enter image description here