Skip to main content
Solved

Sum on column in a quick report

  • December 6, 2022
  • 4 replies
  • 591 views

Forum|alt.badge.img+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:

 

Best answer by chajash

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)

4 replies

Forum|alt.badge.img+10
  • Hero (Customer)
  • 98 replies
  • December 7, 2022

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


Forum|alt.badge.img+10
  • Sidekick (Customer)
  • 107 replies
  • December 7, 2022

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


proharikg
Sidekick (Partner)
Forum|alt.badge.img+9
  • Sidekick (Partner)
  • 81 replies
  • December 7, 2022

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

 


Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • 63 replies
  • Answer
  • December 12, 2022

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)