SLA and KPI report by priority for the given account

SLA and KPI report by priority for the given account

Hello. I need a tabular report that gives me the following:

Priority,Amount of requests,% Response Overdue,% Resolution Overdue
1 - Critical,30,2%,98%
2 - High,x,x%,x%
3 - Medium,x, x%,x%
4 - Low,x, x%,x%
5 - Planned,x, x%,x%

but it have to obey the account selected, not all.

I already have the following:

  1. select pd.priorityname "Prioridade",
  2. (count(wo.workorderid)) "Quantidade de Solicitações",
  3. (sum(case(is_fr_overdue) when 1 then 1.0 else 0.0 end)*100)/count(wo.workorderid) "% Atendimentos Atrasados",
  4. ((count(wo.workorderid) - sum(case(is_fr_overdue) when 1 then 1.0 else 0.0 end))*100)/count(wo.workorderid) "% Atendimentos Atendidos",
  5. (sum(case(isoverdue) when 1 then 1.0 else 0.0 end)*100)/count(wo.workorderid) "% Resoluções Atrasadas",
  6. ((count(wo.workorderid) - sum(case(isoverdue) when 1 then 1.0 else 0.0 end))*100)/count(wo.workorderid) "% Resoluções Atendidas" from workorder wo 
  7. left join workorderstates wos on wo.workorderid = wos.workorderid 
  8. left join prioritydefinition pd on pd.priorityid = wos.priorityid 
  9. where createdtime >= <from_lastmonth> and createdtime <= <to_lastmonth> 
  10. group by pd.priorityname

                New to ADSelfService Plus?