DBA Data[Home] [Help]

VIEW: APPS.IMC_COUNTRY_ORG_RPT_V

Source

View Text - Preformatted

SELECT nvl(fnd.territory_short_name,'Undefined') Territory, a.country, a.customers, to_char(round(a.customers*100/b.tot,2)) percent from (select country, count(*) customers from hz_parties WHERE party_type = 'ORGANIZATION' group by country) a, (select count(*) tot from hz_parties where party_type='ORGANIZATION') b, fnd_territories_vl fnd where fnd.territory_code(+) = a.country union select 'TOTAL', 'TOTAL', count(*), '100.00' from hz_parties where party_type='ORGANIZATION' order by 3 asc
View Text - HTML Formatted

SELECT NVL(FND.TERRITORY_SHORT_NAME
, 'UNDEFINED') TERRITORY
, A.COUNTRY
, A.CUSTOMERS
, TO_CHAR(ROUND(A.CUSTOMERS*100/B.TOT
, 2)) PERCENT
FROM (SELECT COUNTRY
, COUNT(*) CUSTOMERS
FROM HZ_PARTIES
WHERE PARTY_TYPE = 'ORGANIZATION' GROUP BY COUNTRY) A
, (SELECT COUNT(*) TOT
FROM HZ_PARTIES
WHERE PARTY_TYPE='ORGANIZATION') B
, FND_TERRITORIES_VL FND
WHERE FND.TERRITORY_CODE(+) = A.COUNTRY UNION SELECT 'TOTAL'
, 'TOTAL'
, COUNT(*)
, '100.00'
FROM HZ_PARTIES
WHERE PARTY_TYPE='ORGANIZATION' ORDER BY 3 ASC