Here's som old SQL that makes a nice little table for the sat survery in the K1.
My idea was that this could be pasted into excel really easy so you could create charts, etc...
SELECT Coalesce(FULL_NAME, 'UNASSIGNED') AS NAME,
Max(IF(SATISFACTION_RATING = 1, COUNT, 0)) AS 'POOR',
Max(IF(SATISFACTION_RATING = 2, COUNT, 0)) AS 'Below Average',
Max(IF(SATISFACTION_RATING = 3, COUNT, 0)) AS 'Average',
Max(IF(SATISFACTION_RATING = 4, COUNT, 0)) AS 'Good',
Max(IF(SATISFACTION_RATING = 5, COUNT, 0)) AS 'Excellent',
Max(IF(SATISFACTION_RATING = 0, COUNT, 0)) AS 'Not Rated'
FROM (SELECT U.FULL_NAME,
T.SATISFACTION_RATING,
COUNT(*) AS COUNT
FROM HD_TICKET T
LEFT JOIN USER U
ON T.OWNER_ID = U.ID
GROUP BY U.FULL_NAME,
T.SATISFACTION_RATING) RAW
GROUP BY FULL_NAME
ORDER BY NAME
I hope this helps.
Comments