Advertisement
Advertisement
| 09.11.2008 at 07:18PM PDT, ID: 23725181 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: |
-----FIRST SCRIPT-----
## E_D-Weekly report
## runs on Fri after raw reports complete
## uses CDR Plus w/Notes
from datetime import *
from os.path import *
from os import *
from csv import *
import csv
rpt_name = 'E_D-Weekly'
fpath = 'D:/Users/Reports/' # production path
#fpath = 'Z:/Reports/' #test path
suffix = '.csv' # file suffix
dateformat = '%Y-%m-%d' # dateformat prefix for filenames
logpath = 'D:/Users/Reports/report-log.txt' # production path
#logpath = 'Z:/Reports/report-log.txt' #test path
timestamp = datetime.now() # snap the datetime
# report run constants (verified correct)
iso_run_day = 5 #Friday
# create a log entry
if exists(logpath):
ff = file(logpath, 'ab')
else:
ff = file(logpath, 'w+b')
ff.write(str(timestamp) +',E_D-Weekly Report Launched\n')
if not (timestamp.isoweekday() == iso_run_day): # see if we should generate the report
timestamp = datetime.now()
ff.write(str(timestamp) + ',E_D-Weekly Report:no report generated.\n')
ff.close()
else:
# generate the report
ord_offset = -8 # previous Thursday
ord_end_day = 6 # Wednesday night
source_rpt = 'CDR-w-Notes' #folder and base report name
date_col = 'start_date'
filt_col = 'campaign_no'
filt_value = '6610' #E_D campaign
source_cols = [
'start_date',
'start_time',
'skill_name',
'contact_name',
'ANI_DIALNUM',
'agent_name',
'PreQueue',
'InQueue',
'Routing_Time',
'PostQueue',
'Agent_Time',
'ACW_Time',
'Total_Time',
'callback_time',
'Hold_Time',
'Disp_Code',
'Disp_Name',
'Disp_Comments']
#excluded dispostions: Test Call, TestCall(2)
disp_exclude =['8001669', '8001683']
begin_date = datetime.fromordinal(timestamp.toordinal() + ord_offset)
end_date = datetime.fromordinal(begin_date.toordinal() + ord_end_day)
#print begin_date.date(), '--', end_date.date()
file_list = []
# make source file list
for d in range((end_date.toordinal() - begin_date.toordinal()) + 1):
file_list += [ fpath + source_rpt + '/' + str(date.fromordinal(begin_date.toordinal() + d)) + source_rpt + suffix ]
#print file_list
rows = []
for blk in file_list:
#print blk
if exists(blk): # don't worry about missing files....
f = file(blk, "rb")
tmp = DictReader(f)
for k in tmp:
if (k[filt_col] == filt_value) and (k['Disp_Code'] not in disp_exclude):
jtmp = {}
for j in source_cols:
jtmp.update({j:k[j]})
rows += [jtmp]
f.close()
o_rows = [['Start Time',
'DNIS',
'ANI',
'Pre-Queue Time',
'Queue Time',
'Routing Time',
'Talk Time',
'ACW Time',
'Transfer Time',
'Non-Interactive',
'Interactive',
'Total Duration',
'Agent Name',
'Dispostion',
'Comments']]
for row in rows:
if (row['Disp_Code'] == '8001670') and (row['contact_name'] == row['ANI_DIALNUM']):
non_inter = float(row['Total_Time'])/60.0
inter = 0.0
transfer = non_inter
inter += float(row['ACW_Time'])/60.0
inter += float(row['Hold_Time'])/60.0
else:
non_inter = float(row['PreQueue'])/60.0
non_inter += float(row['InQueue'])/60.0
non_inter += float(row['Routing_Time'])/60.0
non_inter += float(row['PostQueue'])/60.0
non_inter += float(row['callback_time'])/60.0 # zero for now, but if we start using this feature...
inter = float(row['Agent_Time'])/60.0
inter += float(row['ACW_Time'])/60.0
inter += float(row['Hold_Time'])/60.0
transfer = float(row['PostQueue'])/60.0
o_rows += [[
row['start_date'] + ' ' + row['start_time'],
row['contact_name'],
row['ANI_DIALNUM'],
float(row['PreQueue'])/60.0,
float(row['InQueue'])/60.0,
float(row['Routing_Time'])/60.0,
float(row['Agent_Time'])/60.0,
float(row['ACW_Time'])/60.0,
transfer,
non_inter,
inter,
float(row['Total_Time'])/60.0,
row['agent_name'],
row['Disp_Name'],
'"' + str(row['Disp_Comments']) + '"']]
if not exists(fpath + rpt_name):
mkdir(fpath + rpt_name)
fname = fpath + rpt_name + '/' + begin_date.strftime('%m-%d--') + end_date.strftime('%m-%d-%y')+rpt_name + suffix
f = file(fname, 'wb')
writer = csv.writer(f)
writer.writerows(o_rows)
f.close()
timestamp = datetime.now()
ff.write(str(timestamp) + ',E_D-Weekly Report Generated.\n')
ff.close()
----SECOND SCRIPT-----
## P_G-Daily.py
## runs everyday after raw reports complete
## uses CDR Plus w/Notes
from datetime import *
from os.path import *
from os import *
from csv import *
import csv
rpt_name = 'P_G-Daily'
fpath = 'D:/Users/Reports/' # production path
#fpath = 'Z:/Reports/' #test path
suffix = '.csv' # file suffix
dateformat = '%Y-%m-%d' # dateformat prefix for filenames
logpath = 'D:/Users/Reports/report-log.txt' # production path
#logpath = 'Z:/Reports/report-log.txt' #test path
timestamp = datetime.now() # snap the datetime
# report run constants (verified correct)
# Runs every day
# create a log entry
if exists(logpath):
ff = file(logpath, 'ab')
else:
ff = file(logpath, 'w+b')
ff.write(str(timestamp) +',P_G-Daily\n')
# generate the report
ord_offset = -1 # previous day
ord_end_day = 0
source_rpt = 'CDR-w-Notes' #folder and base report name
date_col = 'start_date'
filt_col = 'campaign_no'
filt_value = '7060' #P_G campaign
source_cols = [
'start_date',
'start_time',
'skill_name',
'contact_name',
'ANI_DIALNUM',
'agent_name',
'PreQueue',
'InQueue',
'Agent_Time',
'PostQueue',
'ACW_Time',
'Total_Time',
'Abandon_Time',
'Routing_Time',
'abandon',
'callback_time',
'Logged',
'Hold_Time',
'Disp_Name',
'Disp_Comments']
#excluded dispostions: Test Call, TestCall(2)
disp_exclude =['8001669', '8001683']
begin_date = datetime.fromordinal(timestamp.toordinal() + ord_offset)
end_date = datetime.fromordinal(begin_date.toordinal() + ord_end_day)
#print begin_date.date(), '--', end_date.date()
file_list = []
# make source file list
for d in range((end_date.toordinal() - begin_date.toordinal()) + 1):
file_list += [ fpath + source_rpt + '/' + str(date.fromordinal(begin_date.toordinal() + d)) + source_rpt + suffix ]
#print file_list
rows = []
for blk in file_list:
#print blk
if exists(blk): # don't worry about missing files....
f = file(blk, "rb")
tmp = DictReader(f)
for k in tmp:
jtmp = {}
for j in source_cols:
jtmp.update({j:k[j]})
rows += [jtmp]
f.close()
o_rows = [['Start Time',
'skill_name',
'contact_name',
'ANI_DIALNUM',
'agent_name',
'PreQueue',
'InQueue',
'Agent_Time',
'PostQueue',
'ACW_Time',
'Total_Time',
'Abandon_Time',
'Routing_Time',
'abandon',
'callback_time',
'Logged',
'Hold_Time',
'Disp_Name',
'Disp_Comments']]
for row in rows:
o_rows += [[
row['start_date'] + ' ' + row['start_time'],
row['skill_name'],
row['contact_name'],
row['ANI_DIALNUM'],
row['agent_name'],
row['PreQueue'],
row['InQueue'],
row['Agent_Time'],
row['PostQueue'],
row['ACW_Time'],
row['Total_Time'],
row['Abandon_Time'],
row['Routing_Time'],
row['abandon'],
row['callback_time'],
row['Logged'],
row['Hold_Time'],
row['Disp_Name'],
'"' + str(row['Disp_Comments']) + '"']]
if not exists(fpath + rpt_name):
mkdir(fpath + rpt_name)
fname = fpath + rpt_name + '/' + begin_date.strftime('%m-%d--') + end_date.strftime('%m-%d-%y')+rpt_name + suffix
f = file(fname, 'wb')
writer = csv.writer(f)
writer.writerows(o_rows)
f.close()
timestamp = datetime.now()
ff.write(str(timestamp) + ',P_G-Daily Report Generated.\n')
ff.close()
|