Ratio to report function



Purpose

RATIO_TO_REPORT is an analytic function. It computes the ratio of a value to the sum of a set of values. If expr evaluates to null, then the ratio-to-report value also evaluates to null.

Query

SELECT qry.party_name, qry.revenue, RATIO_TO_REPORT(revenue) OVER () AS rr
   FROM
(select (select party_name from hz_parties p, hz_cust_accounts ca where ca.party_id = p.party_id and cust_account_id = ps.customer_id) party_name
, sum(amount_due_original) revenue
from ar_payment_schedules_all ps
where class = 'INV'
group by ps.customer_id) qry

Comments

Popular posts from this blog

Query to get FSG report details with row/column set

How to use lexical parameters in Data template (XML document) R12

Sub Inventory Transfer API.