Query to analyze a performance of a User.
We are on 12.1.3
In this i want to count PR which is
1. approved but not converted to PO.
2.PR is not approved > 1 day
/* Formatted on 2013/03/11 10:36 (Formatter Plus v4.8.8) */
SELECT created_by, user_name, description,
( NVL (SUM (approved), 0)
+ NVL (SUM (cancelled), 0)
+ NVL (SUM (incomplete), 0)
+ NVL (SUM (rejected), 0)
+ NVL (SUM (returned), 0)
) pr_raised,
NVL (SUM (approved), 0) approved, NVL (SUM (cancelled), 0) cancelled,
NVL (SUM (incomplete), 0) incomplete,
NVL (SUM (rejected), 0) rejected, NVL (SUM (returned), 0) returned
FROM (SELECT DECODE (prha.authorization_status,
'APPROVED', COUNT (*)
) approved,
DECODE (prha.authorization_status,
'CANCELLED', COUNT (*)
) cancelled,
DECODE (prha.authorization_status,
'INCOMPLETE', COUNT (*)
) incomplete,
DECODE (prha.authorization_status,
'REJECTED', COUNT (*)
0