Query to find the number of follow up sent by technician

Query to find the number of follow up sent by technician

Use Case

The query retrieves the count of number of conversation matching the keywords

Sample Table



DB: MSSQL & Postgres

Query

select wo.WORKORDERID "Request ID", 
longtodate(wo.CREATEDTIME) "Created Time", 
qd.QUEUENAME "Group", 
wo.TITLE "Subject", 
pd.PRIORITYNAME "Priority", 
count(notificationtodesc.notificationid) "No.of follow up" from notificationtodesc 
left join notification no1 on notificationtodesc.notificationid=no1.notificationid 
left join notify_workorder nwo1 on no1.notificationid=nwo1.notificationid 
left join workorder wo on nwo1.workorderid=wo.workorderid
LEFT JOIN WorkOrderStates wos ON wo.WORKORDERID=wos.WORKORDERID 
LEFT JOIN PriorityDefinition pd ON wos.PRIORITYID=pd.PRIORITYID 
LEFT JOIN StatusDefinition std ON wos.STATUSID=std.STATUSID 
LEFT JOIN WorkOrder_Queue woq ON wo.WORKORDERID=woq.WORKORDERID 
LEFT JOIN QueueDefinition qd ON woq.QUEUEID=qd.QUEUEID
where notificationtodesc.description like '%follow%' or no1.notificationtitle like '%follow%' and  wo.CREATEDTIME >= <from_thisweek> AND wo.CREATEDTIME <= <to_thisweek>
group by wo.WORKORDERID,wo.CREATEDTIME,qd.QUEUENAME,wo.TITLE,pd.PRIORITYNAME

Note :

Description keyword is highlighted in yellow and subject in green. 

Available Date Templates

    • Today - <from_today> - <to_today>
    • This week - <from_thisweek> - <to_thisweek>
    • Last week - <from_lastweek> - <to_lastweek>
    • This month - <from_thismonth> - <to_thismonth>
    • Last month - <from_lastmonth> - <to_lastmonth>
    • This quarter - <from_thisquarter> - <to_thisquarter>
    • Last quarter - <from_lastquarter> - <to_lastquarter>
    • Yesterday - <from_yesterday> - <to_yesterday>
    • This year - <from_thisyear> - <to_thisyear>
    • Last year - <from_lastyear> - <to_lastyear>

                    New to ADSelfService Plus?