|
-
Hi,
The best Oracle tool to create a matrix report is Oracle Report Builder. If you do not have any expirience with it, for your case you can try a query like this one:
select
c_name,
sum(decode(mon, 'Jan', pono, 0)) jan,
sum(decode(mon, 'Feb', pono, 0)) feb,
.....
.....
sum(decode(mon, 'Nov', pono, 0)) nov,
sum(decode(mon, 'Dec', pono, 0)) dec,
sum(decode(mon, 'Mon_Total', pono, 0)) mtotal
from (
select decode(grouping(c_name), 1, 'Total', c_name) c_name,
decode(grouping(month), 0, month, 'Mon_Total') mon,
sum(po_no) pono
from t
group by cube(c_name, month)
)
group by c_name
And the result may look like:
C_NAME JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC MON_TOTAL
------------------------------ ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- -------------
Jim 1 2 3 4 5 6 7 8 9 10 11 12 78
John 10 20 30 40 50 60 70 80 90 100 110 120 780
Total 11 22 33 44 55 66 77 88 99 110 121 132 858
Hope this helps
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|