HI,
I have a 20000 records table containing (at least) these columns:
SAMPLE DATA
I do a grouped select count:
Giving me a grouped summary of the amount of tickets per week, group and type, where the main criteria is "in SLA" = 0 returning something like this:
Now I want an additional column filled with the count of the total for the same criteria's but now also for tickets in sla ("in sla" = 1 or " in sla" = 0)
With this additional result I can calcultate the percentage of tickets that are out of SLA (out of SLA = too late) for the total amount of tickets per week, group and type...
How can I incorporate the returned values of a record in a subquery to count and return the totals within the same record...???
Any help is appreciated...
Thansk,
Jeroen
ps Created this post in a text editor, copying and pasting in notepad maybe restores the readability of the sample data :-)
I have a 20000 records table containing (at least) these columns:
SAMPLE DATA
Code:
week process_type Group in SLA Importance Active 201142 Change Management IN.Intel.Central 1 Production 1 201142 Incident Management IN.Intel.Central 0 Small Change 1 201143 Incident Management IN.Intel.Central 1 3 0 201143 Incident Management IN.Unix.HP 1 2 0 201144 Change Management IN.Unix.HP 1 Standard Change 1 201144 Change Management IN.Unix.HP 0 Standard Change 1 201144 Change Management IN.Unix.HP 1 Standard Change 1
Code:
SELECT Sheet1.week
, Sheet1.process_type
, Sheet1.Group
, Sheet1.[in SLA]
, Sheet1.Importance
, Sheet1.Active
, Count(Sheet1.ID) AS CountOfID
FROM Sheet1
GROUP BY Sheet1.week
, Sheet1.process_type
, Sheet1.Group
, Sheet1.[in SLA]
, Sheet1.Importance
, Sheet1.Active
HAVING (((Sheet1.process_type)="Change Management")
AND ((Sheet1.[in SLA])=0)
AND ((Sheet1.Active)=0));
Code:
week process_type Group in SLA Active CountOfID 201142 Change Management IN.Unix.HP 0 0 2 201143 Change Management IN.Unix.HP 0 0 2 201143 Change Management IN.Windows.COD 0 0 1 201143 Change Management PL.AppsMgmt.ANG 0 0 1 201143 Change Management PL.AppsMgmt. 0 0 1 201143 Change Management PL.Intel 0 0 1 201144 Change Management IN.Intel.South 0 0 2
With this additional result I can calcultate the percentage of tickets that are out of SLA (out of SLA = too late) for the total amount of tickets per week, group and type...
How can I incorporate the returned values of a record in a subquery to count and return the totals within the same record...???
Any help is appreciated...
Thansk,
Jeroen
ps Created this post in a text editor, copying and pasting in notepad maybe restores the readability of the sample data :-)
Comment