Solved

Sum on column in a quick report

  • 6 December 2022
  • 4 replies
  • 338 views

Userlevel 3
Badge +10

This might be a simple question, but it is something I have never done.

Is there an easy way to sum a column on a quick report? 

Basically, I created a view and based the quick report off of view, but now need a sum to appear at the bottom of a column.

like this:

 

icon

Best answer by chajash 12 December 2022, 17:41

View original

4 replies

Userlevel 5
Badge +10

I don’ believe it is possible through Quick Report, you must do it via Business Report. Thanks 

Userlevel 5
Badge +10

hi @chajash , you cannot create grand total on quick report, instead you can do that in SQL query. please refer the following link. Hope this helps.

 

https://community.oracle.com/tech/developers/discussion/2329567/how-to-create-a-grand-total

Userlevel 5
Badge +9

Hi @chajash ,

It is possible through quick report (need to use ‘UNION ALL’ and ‘WITH’ clause). I have done that before and it was working.

 

 

WITH T AS  

(SELECT PROD_FAMILY, NO_of_Parts, Total_inv_value from view1) 

   SELECT * FROM T 

UNION ALL 

SELECT SUM("Total_inv_value"),'TOTAL','' FROM T 

 

Best Regards,

Hari

 

Userlevel 3
Badge +10

Got it to work using Grouping Sets

Works in the quick report as well.

 

SELECT
    prod_family,
    count(prod_family)as number_of_parts,
    sum(extended) as total_inventory_value
FROM
    agr_rep_inv_status
WHERE
    frequency_class LIKE '&Frequency_Class'
GROUP BY grouping SETS
    ((),(prod_family))
Order by grouping
    (prod_family)

Reply