Report - Percentage
I have a table with this structure and content:
COD AMOUNT MARK
------------------------------------------
1 10 2
1 10 3
2 10 2
1 10 2
I would like to produce a report with this layout:
COD TOTAL TOTAL2 % TOTAL2/TOTAL
----------------------------------------------------------------------
1 30 20 66,67%
2 10 10 100,00%
where:
COD - code
TOTAL - sum of column AMOUNT of certain code
TOTAL2 - sum of column AMOUNT of certain code and column MARK = 2
TOTAL2/TOTAL - percentage of TOTAL2 and TOTAL
How can I do this?