Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Summary Formulae in a Crosstab

Status
Not open for further replies.

fionama

MIS
Mar 4, 2005
28
IE
Hi,
I am trying to create a crosstab relating to A&E attendances. The crosstab should contain a count of all A&E attendances, a count of A&E attendances where the outcome was "Admitted", and this is summarised by month of attendance.

No A&E Att's No of Admissions
July 1200 500
August 1180 525
September 1105 499

I have created a function A&EAdms :-
If {EpisodeE.Discharge_Code}="9" Then 1 Else 0

and then created another function (NoOfAdms) using that :-
Sum({@A&EAdms})

and tried to put this function NoOfAdms, along with NoOfAtts and AttMonth into a crosstab, but it's not working.

Does anyone have any ideas? Thanks in advance,
Fiona
 
Do you mean that the sum isn't working? Or that it works but that the Crosstab won't accept it? Also which version of Crystal?

I'd advise doing the count as a running total, right-click on the field and select running total. Use {EpisodeE.Discharge_Code}="9" as the evaluation rule.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I don't think you need a crosstab for this. Insert a group on date (monthly) and then add your formula to the detail section:

If {EpisodeE.Discharge_Code}="9" Then 1 Else 0

Right click on this and insert a summary (sum, not count). Also insert a summary (count) on your attendances field. Then drag the groupname into the group footer, and suppress the group header and the details section.

-LB
 
Sorry it took so long to get back to you. Both of those worked. Thanks very much. Fiona
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top