Skip to content

Commit 836981e

Browse files
author
Torben
committed
✨ Added Escalation Flag into the First Level Support Resolution Query
1 parent f735bf5 commit 836981e

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

resolution_rate_in_first_level_support.sql renamed to resolution_rate_in_first_level_support_AND_escalation_rate.sql

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,26 @@ SELECT
88
welche an eine NICHT-First-Level-Support-Rolle weitergeleitet wurden.
99
*/
1010
CASE
11-
WHEN COUNT(journal.[Expression-ObjectID]) = 0 THEN 1
11+
WHEN ticketCommon.State = 204
12+
AND COUNT(journal.[Expression-ObjectID]) = 0 THEN 1
1213
ELSE 0
13-
END AS IsFirstLevelSupportResolution
14+
END AS IsFirstLevelSupportResolution,
15+
/*
16+
Die Bedingung ist wahr, wenn es mindestens eine historische Aktion vom Typ "Weiterleitung an Rolle" gibt,
17+
welche an eine NICHT-First-Level-Support-Rolle weitergeleitet wurde.
18+
*/
19+
CASE
20+
WHEN COUNT(journal.[Expression-ObjectID]) > 0 THEN 1
21+
ELSE 0
22+
END AS IsEscalated
1423
FROM
1524
dbo.SPSActivityClassBase AS ticket
1625
LEFT OUTER JOIN (
1726
SELECT
18-
[Expression-ObjectID]
27+
[Expression-ObjectID],
28+
State
1929
FROM
2030
dbo.SPSCommonClassBase
21-
WHERE
22-
/* Nur Tickets im Status "Geschlossen" */
23-
State = 204
2431
) AS ticketCommon ON ticket.[Expression-ObjectID] = ticketCommon.[Expression-ObjectID]
2532
/* Wir erzeugen Zeilen, in welcher entweder (NULL) oder die KPI verletzende Weiterleitungs-Aktion vorkommt. */
2633
LEFT OUTER JOIN (
@@ -43,5 +50,6 @@ FROM
4350
) AS journal ON ticketCommon.[Expression-ObjectID] = journal.[Expression-ObjectID]
4451
GROUP BY
4552
-- ticket.[Expression-ObjectID], -- Uncomment if ObjectID is needed (Warning: performance impact)
53+
ticketCommon.State,
4654
ticket.ID,
4755
ticket.ClosedDate;

0 commit comments

Comments
 (0)