1. report summary
TRANSCRIPT
1. Report Summary
Report Name CSDNEW/CSDNEW Reports/CSD - Officer Production Stats
Report ID 1116
Functional Group Consumer Services Division
2. Purpose The purpose of this report is to track case statistics by officer and by month. This report uses the same methodology that is used in the division and bureau production reports. The stats by officer are all calculated via a database view, this view uses all the tables needed to gather all statistics while using a report param table to determine the user inputs when running the report. So the report itself is quite simple, a simple query of the view along with totals calculated at the bottom of the page for an officer. The report can be run for one or more months which the user selects at runtime. The report can be run for one officer or for all officers within a bureau. When “all officers” are selected, each officer will appear on one page with every row consisting of a month’s worth of stats up to the number of months selected. Report name: csdofcr1 Per Elena Barnum’s email on 2/9/2017: There is no need to use pay-period for the monthly case stats report. It should run based on a calendar month and not a pay-period. Note that this report has an error needing to be fixed per Lucy’s email on 10/21/2016: (Bert just reviewed: doesn’t appear to be an error.. 13 is the correct value in the example below) …the 20 Go live reports are OK as is, with the exception of the logic on one of the fields (Violations) in the officer production report (1st image). It appears when the production report for the officer is run (same at the Bureau or Division Level), it’s counting the number of lines as opposed to adding the actual violation total. For example, in the month of January 2016, Coleen issued 14 violations on 9 cases but only 13 showed up because for case 7031732 (second image below), she cited the company for violating the same statute twice. It appears the report is counting the lines vs. the data from the “viol totl” field.
This file was generated using an evaluation version of Muhimbi'sDocument Converter. Visit www.muhimbi.com for more information.
3. Report Elements
Report Element Name Report Element Description
Month User Parameter
Officer User Parameter
Cases Carried Over PMO Number
Cases Opened Number
Cases Re-Opened Number
Cases Closed Number
Case Carryover NextMo Number
Cases Closed 02 Sts Number
Justified Number
Violations Number
Cases with Violations Number
Recovery Amount Dollar Amount
Cases 01 to 60 Days Number
Cases 61 to 90 Days Number
Cases 91 to 120 Days Number
Cases Over 120 Days Number
Sph Count Number
Sph 14w (provider) Number
Sph 39 (IMR) Number
Cases with Recent Activities Number
Cases >90 Days of no Activity Number
This file was generated using an evaluation version of Muhimbi'sDocument Converter. Visit www.muhimbi.com for more information.
4. Tables/Stored Procedures/Views
5. Prompts, Conditions, Grouping, Sorting
Prompt Prompt Name Default Value Mandatory(Y/N)
Bureau CCB Y
Beg Date (mm/yyyy) 09/2016
Y
End Date (mm/yyyy) 09/2016 Y
Officer Eid All Users Y
Conditions
Grouping
Sorting
6. Calculations The table below identifies calculations/formulas used for a report element.
ID Report Element Calculation
ID Table/SP/View Name Description
CAS.REPT_PARAMS
CAS. TMP_OFCR_MATCH
CAS.OFCRSUM_V
- CAS.CAS_CASES
- CAS.CAS_ACTIVITIES
- CAS_SPECIAL_HANDLING
- CAS.TMP_OFCR_MATCH
IDB.PERSONNEL
IDB.USERS
This file was generated using an evaluation version of Muhimbi'sDocument Converter. Visit www.muhimbi.com for more information.
7. Distribution
Individuals, roles or units
Accessible to individuals who can access CSD Reports.
Distribution Format This is an on-demand report that is accessible via PDF.
8. Frequency This report will be generated on demand.
This file was generated using an evaluation version of Muhimbi'sDocument Converter. Visit www.muhimbi.com for more information.
9. SCREENSHOTS
csdofcr1.rdf
This file was generated using an evaluation version of Muhimbi'sDocument Converter. Visit www.muhimbi.com for more information.
10. SQL FIELDS REFERENCED
Schema
Table Name Column Name CRM
Entity/Table
CRM Column Description
CAS CAS_CASES BUREAU_CODE incident CSD_BUREAU CAS CAS_CASES CLOSE_DATE incident CSD_CLOSEDATE CAS CAS_CASES OFCR_EID incident ownerid CAS REPT_PARAMS BEG_DATE
CRM does not have a "rept_params" related table.
CAS REPT_PARAMS BUREAU
CAS REPT_PARAMS OFCR
CAS REPT_PARAMS REP_NAME
CAS TMP_OFCR_MATCH FULLNAME systemuser fullname CAS TMP_OFCR_MATCH OFCR_EID systemuser cpl_eid CAS TMP_OFCR_MATCH OFFICE_CODE systemuser businessunitid Lookup CAS TMP_OFCR_MATCH USERNAME systemuser domainname IDB PERSONNEL EID systemuser cpl_eid
IDB PERSONNEL RELEASE_DATE
systemuser modifiedon, isdisabled
In CRM, we change the status of the user record to disabled when the user is released, so use modifiedon field for RELESE_DATE and also isdisabled field value should be Disabled.
IDB PERSONNEL SUPERVISOR_EID systemuser cpl_supeid IDB USERS EID systemuser fullname IDB USERS EW_AREA_CODE systemuser businessunitid IDB USERS USERNAME systemuser fullname
Schema View Name Column Name CRM
Entity/Table CRM
Column Description / Comments
CAS REPOFCRUM_V CA_LST_MO
CRM does not have a "rept_params" related table. This view is mostly based on that rept_params table. Therefore, we are not able to map these fields. PAY_PERIOD is no longer needed as the report will be run by calendar month now instead.
CAS REPOFCRUM_V CARRYNEXT
CAS REPOFCRUM_V CLOSED
CAS REPOFCRUM_V CLOSED02
CAS REPOFCRUM_V JUSTIFIED
CAS REPOFCRUM_V LESS31
CAS REPOFCRUM_V MONTHX
CAS REPOFCRUM_V OFCR
CAS REPOFCRUM_V OPEN
CAS REPOFCRUM_V OVER30
CAS REPOFCRUM_V OVER60
CAS REPOFCRUM_V OVER90
CAS REPOFCRUM_V PAY_PERIOD
CAS REPOFCRUM_V RECENT_ACT_CT
CAS REPOFCRUM_V RECOV_AMT
CAS REPOFCRUM_V REOPEN
CAS REPOFCRUM_V SPH_14W
CAS REPOFCRUM_V SPH_39
This file was generated using an evaluation version of Muhimbi'sDocument Converter. Visit www.muhimbi.com for more information.
CAS REPOFCRUM_V SPH_CT
CAS REPOFCRUM_V VIOCASES
CAS REPOFCRUM_V VIOLATIONS
11. SQL FROM XML
Criteria / SQL
SELECT EW_AREA_CODE FROM IDB.USERS WHERE USERNAME = USER AND EW_AREA_CODE IN ('CSB','RUS','CCB','HCB') UNION SELECT 'CSB' FROM IDB.USERS WHERE USERNAME LIKE USER AND EW_AREA_CODE IN ('ITS','CSD') UNION SELECT 'HCB' FROM IDB.USERS WHERE USERNAME LIKE USER AND EW_AREA_CODE IN ('ITS','CSD') UNION SELECT 'RUS' FROM IDB.USERS WHERE USERNAME LIKE USER AND EW_AREA_CODE IN ('ITS','CSD') UNION SELECT 'CCB' FROM IDB.USERS WHERE USERNAME LIKE USER AND EW_AREA_CODE IN ('ITS','CSD')
SELECT NULL,' ALL USERS' FROM DUAL UNION SELECT U.EID, USERNAME FROM IDB.USERS U, IDB.PERSONNEL P WHERE EW_AREA_CODE IN ('CSB','CCB','RUS','HCB') AND U.EID = P.EID AND NVL(P.RELEASE_DATE,SYSDATE) > SYSDATE -520 ORDER BY 2
SELECT ofcr_eid, fullname, u.username supervisor FROM cas.tmp_ofcr_match tom, idb.personnel p, cas.rept_params rp, idb.users u WHERE tom.office_code = rp.bureau AND tom.ofcr_eid = nvl(rp.ofcr,tom.ofcr_eid) AND p.eid = tom.ofcr_eid AND u.eid = p.supervisor_eid AND rep_name like 'ofcr_summary' AND nvl(p.release_date,sysdate+60) > rp.beg_date-60 AND exists (SELECT distinct ofcr_eid FROM cas.cas_cases WHERE ofcr_eid = tom.ofcr_eid AND nvl(close_date,sysdate) > rp.beg_date AND bureau_code = RP.BUREAU) ORDER BY tom.username
SELECT monthx,pay_period,a.ofcr, a.ca_lst_mo, a.open, a.reopen,a.closed, a.closed02, a.justified, a.violations, a.viocases, a.carrynext, a.recov_amt, a.less31, a.over30, a.over60, a.over90, a.sph_ct, a.sph_14w, a.sph_39, a.recent_act_ct,a.carrynext-a.recent_act_ct no_recent_act FROM cas.repofcrum_v a ORDER BY pay_period
This file was generated using an evaluation version of Muhimbi'sDocument Converter. Visit www.muhimbi.com for more information.
DEFINITION FOR VIEW [CAS].[ REPOFCRUM_V] CREATE OR REPLACE FORCE VIEW CAS.REPOFCRUM_V
(
USERNAME,
OFCR,
PAY_PERIOD,
MONTHX,
CA_LST_MO,
OPEN,
REOPEN,
CLOSED,
CLOSED02,
JUSTIFIED,
VIOLATIONS,
VIOCASES,
CARRYNEXT,
RECOV_AMT,
LESS31,
OVER30,
OVER60,
OVER90,
SPH_CT,
SPH_14W,
SPH_39,
RECENT_ACT_CT
)
AS
(SELECT a.username,
ofcr_eid ofcr,
pp.pay_period,
INITCAP (
RTRIM (TO_CHAR (TO_DATE (pp.pay_period, 'rrrrmm'), 'month'))
|| '-'
|| TO_CHAR (TO_DATE (pp.pay_period, 'rrrrmm'), 'yy'))
monthx,
(SELECT COUNT (ofcr_eid) CA_LST_MO
FROM cas.cas_cases C
WHERE NVL (close_date, SYSDATE) >=
TO_DATE (pay_period, 'rrrrmm')
AND (TO_DATE (pay_period, 'rrrrmm') - open_date) >= 1
AND bureau_code = rp.bureau
AND c.OFCR_EID = a.ofcr_eid)
CA_LST_MO,
(SELECT COUNT (ofcr_eid)
FROM cas.cas_cases x
WHERE open_date >= TO_DATE (pay_period, 'rrrrmm')
AND open_date <= LAST_DAY (TO_DATE (pay_period, 'rrrrmm'))
AND bureau_code = rp.bureau
AND x.ofcr_eid = a.ofcr_eid)
open,
(SELECT COUNT (ofcr_eid)
FROM cas.cas_activities x, cas.cas_cases c
WHERE activity_date >= TO_DATE (pay_period, 'rrrrmm')
AND activity_date <=
LAST_DAY (TO_DATE (pay_period, 'rrrrmm'))
AND x.bureau_code = rp.bureau
AND c.ofcr_eid = a.ofcr_eid
AND activity_code = '09'
This file was generated using an evaluation version of Muhimbi'sDocument Converter. Visit www.muhimbi.com for more information.
AND c.rid = x.rid
AND c.bureau_code = x.bureau_code)
reopen,
(SELECT COUNT (ofcr_eid)
FROM CAS.cas_cases y
WHERE close_date >= TO_DATE (pay_period, 'rrrrmm')
AND close_date <=
LAST_DAY (TO_DATE (pay_period, 'rrrrmm'))
AND BUREAU_CODE = rp.bureau
AND y.ofcr_eid = a.ofcr_eid)
closed,
(SELECT COUNT (ofcr_eid)
FROM CAS.cas_cases y
WHERE close_date >= TO_DATE (pay_period, 'rrrrmm')
AND close_date <=
LAST_DAY (TO_DATE (pay_period, 'rrrrmm'))
AND BUREAU_CODE = rp.bureau
AND STATUS_CODE = '02'
AND y.ofcr_eid = a.ofcr_eid)
closed02,
(SELECT COUNT (ofcr_eid)
FROM CAS.cas_cases y, CAS.CAS_SUBJ_RELATION CSR
WHERE close_date >= TO_DATE (pay_period, 'rrrrmm')
AND close_date <=
LAST_DAY (TO_DATE (pay_period, 'rrrrmm'))
AND CSR.RID = Y.RID
AND CULPABLE = '01'
AND y.BUREAU_CODE = rp.bureau
AND y.bureau_code = csr.bureau_code
AND y.ofcr_eid = a.ofcr_eid)
justified,
(SELECT SUM (NVL (CV.vio_tot, 1))
FROM CAS.cas_cases y, CAS.CAS_violation CV
WHERE close_date >= TO_DATE (pay_period, 'rrrrmm')
AND close_date <=
LAST_DAY (TO_DATE (pay_period, 'rrrrmm'))
AND CV.RID = Y.RID
AND y.BUREAU_CODE = rp.bureau
AND y.ofcr_eid = a.ofcr_eid)
violations,
(SELECT COUNT (DISTINCT y.rid)
FROM CAS.cas_cases y, CAS.CAS_violation CV
WHERE close_date >= TO_DATE (pay_period, 'rrrrmm')
AND close_date <=
LAST_DAY (TO_DATE (pay_period, 'rrrrmm'))
AND CV.RID = Y.RID
AND y.BUREAU_CODE = rp.bureau
AND y.ofcr_eid = a.ofcr_eid)
viocases,
(SELECT COUNT (ofcr_eid)
FROM cas.cas_cases z
WHERE NVL (close_date, SYSDATE) >
LAST_DAY (TO_DATE (pay_period, 'rrrrmm'))
AND (LAST_DAY (TO_DATE (pay_period, 'rrrrmm')) - open_date) >=
0
AND bureau_code = rp.bureau
AND z.ofcr_eid = a.ofcr_eid)
carrynext,
(SELECT SUM (u.recovery_amt)
FROM CAS.cas_cases u
This file was generated using an evaluation version of Muhimbi'sDocument Converter. Visit www.muhimbi.com for more information.
WHERE CLOSE_DATE BETWEEN TO_DATE (pay_period, 'rrrrmm')
AND LAST_DAY (
TO_DATE (pay_period, 'rrrrmm'))
AND bureau_code = rp.bureau
AND u.ofcr_eid = a.ofcr_eid)
recov_amt,
(SELECT COUNT (*)
FROM cas.cas_cases cc
WHERE NVL (close_date, SYSDATE) >
LAST_DAY (TO_DATE (pay_period, 'rrrrmm'))
AND (LAST_DAY (TO_DATE (pay_period, 'rrrrmm')) - open_date)
BETWEEN 0
AND 60
AND bureau_code = rp.bureau
AND CC.ofcr_eid = a.ofcr_eid)
LESS31,
(SELECT COUNT (*)
FROM cas.cas_cases cc
WHERE NVL (close_date, SYSDATE) >
LAST_DAY (TO_DATE (pay_period, 'rrrrmm'))
AND (LAST_DAY (TO_DATE (pay_period, 'rrrrmm')) - open_date)
BETWEEN 61
AND 90
AND bureau_code = rp.bureau
AND CC.ofcr_eid = a.ofcr_eid)
over30,
(SELECT COUNT (*)
FROM cas.cas_cases cc
WHERE NVL (close_date, SYSDATE) >
LAST_DAY (TO_DATE (pay_period, 'rrrrmm'))
AND (LAST_DAY (TO_DATE (pay_period, 'rrrrmm')) - open_date)
BETWEEN 91
AND 120
AND bureau_code = rp.bureau
AND CC.ofcr_eid = a.ofcr_eid)
over60,
(SELECT COUNT (*)
FROM cas.cas_cases cc
WHERE NVL (close_date, SYSDATE) >
LAST_DAY (TO_DATE (pay_period, 'rrrrmm'))
AND (LAST_DAY (TO_DATE (pay_period, 'rrrrmm')) - open_date) >
120
AND bureau_code = rp.bureau
AND CC.ofcr_eid = a.ofcr_eid)
over90,
(SELECT COUNT (*)
FROM cas.cas_cases c, cas.cas_special_handling h
WHERE c.rid = h.rid
AND c.ofcr_eid = a.ofcr_eid
AND c.open_date BETWEEN TO_DATE (pay_period, 'rrrrmm')
AND LAST_DAY (
TO_DATE (pay_period, 'rrrrmm')))
sph_ct,
(SELECT COUNT (*)
FROM cas.cas_cases c, cas.cas_special_handling h
WHERE c.rid = h.rid
AND c.ofcr_eid = a.ofcr_eid
This file was generated using an evaluation version of Muhimbi'sDocument Converter. Visit www.muhimbi.com for more information.
AND sh_code = '14W'
AND c.open_date BETWEEN TO_DATE (pay_period, 'rrrrmm')
AND LAST_DAY (
TO_DATE (pay_period, 'rrrrmm')))
sph_14W,
(SELECT COUNT (DISTINCT c.rid)
FROM cas.cas_cases c, cas.cas_special_handling h
WHERE c.rid = h.rid
AND c.ofcr_eid = a.ofcr_eid
AND sh_code LIKE '39%'
AND c.open_date BETWEEN TO_DATE (pay_period, 'rrrrmm')
AND LAST_DAY (
TO_DATE (pay_period, 'rrrrmm')))
sph_39,
(SELECT COUNT (DISTINCT z.rid)
FROM cas.cas_cases z, cas.cas_activities ca
WHERE NVL (close_date, SYSDATE) >
LAST_DAY (TO_DATE (pay_period, 'rrrrmm'))
AND (LAST_DAY (TO_DATE (pay_period, 'rrrrmm')) - open_date) >=
0
AND ca.rid = z.rid
AND ca.activity_date > TO_DATE (pay_period, 'rrrrmm') - 60
AND ca.activity_date <
ADD_MONTHS (TO_DATE (pay_period, 'rrrrmm'), 1)
AND z.bureau_code = rp.bureau
AND z.ofcr_eid = a.ofcr_eid)
recent_act_ct
FROM cas.tmp_ofcr_match a,
idb.personnel b,
CAS.REPT_PARAMS rp,
timek.tk_pay_period pp,
idb.personnel pe,
idb.users uu
WHERE office_code = rp.bureau
AND POSITION_CODE IN ('S', 'O')
AND a.ofcr_eid = b.eid
AND rp.rep_name = 'ofcr_summary'
AND NVL (a.inactive_date, SYSDATE + 90) >= rp.beg_date
AND (a.ofcr_eid = rp.ofcr OR rp.ofcr IS NULL)
AND uu.username = USER
AND uu.eid = pe.eid
AND ( ( ( pe.position_num LIKE '%8560%'
OR uu.username = 'CLEMSONR')
AND b.supervisor_eid = pe.eid)
OR (pe.position_num NOT LIKE '%8560%' AND 1 = 1))
AND pp.pay_period BETWEEN TO_CHAR (rp.beg_date, 'rrrrmm')
AND TO_CHAR (rp.end_date, 'rrrrmm'));
This file was generated using an evaluation version of Muhimbi'sDocument Converter. Visit www.muhimbi.com for more information.