Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Group Crosstab Post Reply Post New Topic
Author Message
jdwcar
Newbie
Newbie


Joined: 16 Oct 2013
Online Status: Offline
Posts: 3
Quote jdwcar Replybullet Topic: Group Crosstab
    Posted: 21 Oct 2013 at 5:51am
I'm running CR 2011

I'm trying to create a crosstab report inside a Group Header.
Fields are as follows coming from a stored procedure.

ServiceLine
RequestType
FiscalPeriod
StartedToCompleted
Need to calculate average started to completed for each request type for selected date range.

I also have setup a reference table as a left outer join on FiscalPeriod to force all periods to appear.


The Desired Output would be:

[ServiceLine] Medicine
[RequestType]Jul Aug Sep Oct Nov Dec Jan Feb YTD
Admissions    22   19   18                          20
OR/PACU       32   62   81                          69
ER            79   83   61                          74
TC            77   15   154                        106
Unit to Unit 101 95   115                        104

[ServiceLine] Heart
[RequestType]Jul Aug Sep Oct Nov Dec Jan Feb YTD
Admissions    22   19   18                          20
OR/PACU       32   62   81                          69
ER            79   83   61                          74
TC            77   15   154                        106
Unit to Unit 101 95   115                        104

What I'm getting in my results is:

[ServiceLine] Medicine
[RequestType]Jul Aug Sep YTD
Admissions    22   19   18 20
OR/PACU       32   62   81 69
ER            79   83   61 74
TC            77   15   154 106
Unit to Unit 101 95   115 104

It also creates a 'Blank' group with the following:
'others'       Oct Nov Dec Jan etc


I have to group by ServiceLine so I do not have a create a unique report for each of our 15 facilities as they all have unique service lines.

When I create an identical Crosstab in the Report Footer and eliminate the Group and look at overall performance (All service lines)

I get the desired output for overall:

Bed Request TAT:
     Jul Aug Sep Oct Nov Dec Jan Feb Mar Apr May Jun YTD
Adm   14 18 13 0   0   0   0   0   0   0   0   0   15
Cath 61 70 57 0   0   0   0   0   0   0   0   0   64
ER    73 62 60 0   0   0   0   0   0   0   0   0   65
NU   137 176 171 0   0   0   0   0   0   0   0   0 160
OR    60 46 62 0   0   0   0   0   0   0   0   0   56


Any help and/or ideas of what I can do would be greatly appreciated.





      
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 21 Oct 2013 at 6:20am
it is as simple as placing your cross-tab inside group header.
IP IP Logged
jdwcar
Newbie
Newbie


Joined: 16 Oct 2013
Online Status: Offline
Posts: 3
Quote jdwcar Replybullet Posted: 21 Oct 2013 at 6:23am
The crosstab is inside the group header
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 21 Oct 2013 at 6:48am
i see now so you need it to display month columns even if there is no data.
1 option is to create a master table
i did it couple of times
using cross joins
(select distinct
ServiceLine from...)
cross join (select distinct
RequestType )

or you could use formulas instead of cross tab
formula fro each month like
id date in date(2013,1,1) to date(2013,1,31) then amount else 0
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.047 seconds.