Add a % column to a cross tab query

mdgibbs964

New member
Local time
Today, 10:46
Joined
Jan 15, 2013
Messages
4
Hello All,

I have created a cross tab query that contains a row heading for Entity and Total Cases. I would like to have a percentage of the Case Total for Each Category as well as the count for each category. It works fine for just the counts and here is the sql behind it:

TRANSFORM Count(CASEDATA.CASESTATUS) AS CountOfCASESTATUS
SELECT IUIDCODES.CODEDESCRIPTION, Count(CASEDATA.CASETYPECODE) AS CountOfCASETYPECODE
FROM (CASEDATA INNER JOIN CASESTATUSCODES ON CASEDATA.CASESTATUS = CASESTATUSCODES.CODEID) INNER JOIN IUIDCODES ON CASEDATA.IUID = IUIDCODES.CODEID
WHERE (((CASEDATA.CASETYPECODE)=63) AND ((CASEDATA.FYSTATUS)=6 Or (CASEDATA.FYSTATUS)=7 Or (CASEDATA.FYSTATUS)=8))
GROUP BY IUIDCODES.CODEDESCRIPTION
PIVOT CASESTATUSCODES.CODEDESCRIPTION;

Any suggestions?
 
Here is what the output of my query looks like. I would just like to insert % for each category
 

Attachments

  • 4-12-2013 10-03-06 AM.jpg
    4-12-2013 10-03-06 AM.jpg
    30.8 KB · Views: 117
Last edited:
Figured it out. Just did a query based on the crosstab query results and put in the % fields.
 

Users who are viewing this thread

Back
Top Bottom