/build/static/layout/Breadcrumb_cap_w.png

HOW TO: Create a Pivot Table For HelpDesk Satisfaction Survey

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

  • Thank you for the code, works like a charm - sdnbtech1 12 years ago
  • Good stuff. - rbarth 12 years ago
This post is locked
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ