M
Mobiius
Hello,
I have a crosstab query for my contact center which will give me the total
number of incidents which have been resolved at first contact sorted by site,
and by incident creation method.
Basically, the column headers contain the incident creation types:
Telephone, Email, and Web, along with the total numbers of these 3 methods
added up.
The row headers are sites. (In my DB, there are only 3 sites, MH, GH and all
the others, which are blank)
This gets its information from another query which sorts all the data to
provide only the information I require. (Including currently the criteria of
selecting FTF (first tie fix) and non FTF incidents)
What I need to do and have been unable to find out how to do is as well as
crosstabbing FTF incident counts by creation method and by site, I'd also
like a further column header which shows the TOTAL number of incidents. FTF
and non FTF in order to create a percentage value.
Finally, my question is, Is there a way to display the crosstab information
counts of FTF, and have the total number of incidents by site also? I know
that I cant include all data and use a where clause as Jet complains that I
cannot use an aggregate function within a where clause.
The SQL which works but doesn't give me total incidents is:
TRANSFORM Count([All Data Query].Ref) AS CountOfRef
SELECT [All Data Query].Site, MonthName([Month]) AS Month_, Count([All Data
Query].FTF) AS CountOfFTF
FROM [All Data Query]
GROUP BY [All Data Query].Site, [All Data Query].Month, MonthName([Month]),
[All Data Query].Year
ORDER BY [All Data Query].Month
PIVOT [All Data Query].[Creation Method];
And the SQL I'd LIKE to be able to use is:
TRANSFORM Count([All Data Query].Ref) AS CountOfRef
SELECT [All Data Query].Site, MonthName([Month]) AS Month_, Count([All Data
Query].FTF) AS CountOfFTF
FROM [All Data Query]
WHERE (((Count([All Data Query].FTF))=1))
GROUP BY [All Data Query].Site, [All Data Query].Month, MonthName([Month]),
[All Data Query].Year
ORDER BY [All Data Query].Month
PIVOT [All Data Query].[Creation Method];
The SQL for the query the crosstab gets it's data from is also below (Which
doesn't seem to be filtering months or dates for some reason):
SELECT [Imported Data].Ref, [Imported Data].Service, [Imported
Data].[Creation Method], [Imported Data].[RG at Resolve], [Imported
Data].FTF, [Imported Data].[Resolver ID], Creators.Site, [Imported
Data].Month, [Imported Data].Year
FROM Creators INNER JOIN [Imported Data] ON Creators.CreatorID = [Imported
Data].[Resolver ID]
WHERE ((([Imported Data].Service)="DII/F") AND (([Imported Data].[RG at
Resolve])="CIS SPOC" And ([Imported Data].[RG at Resolve])="CIS SPOC") AND
(([Imported Data].Month)="5") AND (([Imported Data].Year)="9")) OR
((([Imported Data].[RG at Resolve])="CIS SPOC TPA")) OR ((([Imported
Data].[RG at Resolve])="DIIF Password-Awaiting authori")) OR ((([Imported
Data].[RG at Resolve])="DIIF Password-Awaiting Closure")) OR ((([Imported
Data].[RG at Resolve])="DLP")) OR ((([Imported Data].[RG at Resolve])="HPT"))
OR ((([Imported Data].[RG at Resolve])="HPT DII/C")) OR ((([Imported
Data].[RG at Resolve])="HPT UOD")) OR ((([Imported Data].[RG at
Resolve])="SPOC ACD Admin"));
I have a crosstab query for my contact center which will give me the total
number of incidents which have been resolved at first contact sorted by site,
and by incident creation method.
Basically, the column headers contain the incident creation types:
Telephone, Email, and Web, along with the total numbers of these 3 methods
added up.
The row headers are sites. (In my DB, there are only 3 sites, MH, GH and all
the others, which are blank)
This gets its information from another query which sorts all the data to
provide only the information I require. (Including currently the criteria of
selecting FTF (first tie fix) and non FTF incidents)
What I need to do and have been unable to find out how to do is as well as
crosstabbing FTF incident counts by creation method and by site, I'd also
like a further column header which shows the TOTAL number of incidents. FTF
and non FTF in order to create a percentage value.
Finally, my question is, Is there a way to display the crosstab information
counts of FTF, and have the total number of incidents by site also? I know
that I cant include all data and use a where clause as Jet complains that I
cannot use an aggregate function within a where clause.
The SQL which works but doesn't give me total incidents is:
TRANSFORM Count([All Data Query].Ref) AS CountOfRef
SELECT [All Data Query].Site, MonthName([Month]) AS Month_, Count([All Data
Query].FTF) AS CountOfFTF
FROM [All Data Query]
GROUP BY [All Data Query].Site, [All Data Query].Month, MonthName([Month]),
[All Data Query].Year
ORDER BY [All Data Query].Month
PIVOT [All Data Query].[Creation Method];
And the SQL I'd LIKE to be able to use is:
TRANSFORM Count([All Data Query].Ref) AS CountOfRef
SELECT [All Data Query].Site, MonthName([Month]) AS Month_, Count([All Data
Query].FTF) AS CountOfFTF
FROM [All Data Query]
WHERE (((Count([All Data Query].FTF))=1))
GROUP BY [All Data Query].Site, [All Data Query].Month, MonthName([Month]),
[All Data Query].Year
ORDER BY [All Data Query].Month
PIVOT [All Data Query].[Creation Method];
The SQL for the query the crosstab gets it's data from is also below (Which
doesn't seem to be filtering months or dates for some reason):
SELECT [Imported Data].Ref, [Imported Data].Service, [Imported
Data].[Creation Method], [Imported Data].[RG at Resolve], [Imported
Data].FTF, [Imported Data].[Resolver ID], Creators.Site, [Imported
Data].Month, [Imported Data].Year
FROM Creators INNER JOIN [Imported Data] ON Creators.CreatorID = [Imported
Data].[Resolver ID]
WHERE ((([Imported Data].Service)="DII/F") AND (([Imported Data].[RG at
Resolve])="CIS SPOC" And ([Imported Data].[RG at Resolve])="CIS SPOC") AND
(([Imported Data].Month)="5") AND (([Imported Data].Year)="9")) OR
((([Imported Data].[RG at Resolve])="CIS SPOC TPA")) OR ((([Imported
Data].[RG at Resolve])="DIIF Password-Awaiting authori")) OR ((([Imported
Data].[RG at Resolve])="DIIF Password-Awaiting Closure")) OR ((([Imported
Data].[RG at Resolve])="DLP")) OR ((([Imported Data].[RG at Resolve])="HPT"))
OR ((([Imported Data].[RG at Resolve])="HPT DII/C")) OR ((([Imported
Data].[RG at Resolve])="HPT UOD")) OR ((([Imported Data].[RG at
Resolve])="SPOC ACD Admin"));