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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Breaking down data in the details section 2

Status
Not open for further replies.

shaunhubbs

Technical User
Jun 6, 2005
57
CA
Hi,

I have produced a report that gives me a breakdown of the number of surgeries that have been booked at a hospital by hospital and then further by a category. (Eg. Hospital #1 has stats for General Surgery, Urology, etc. and Hospital #2 has its own stats for the same categories.)

What I would like to do, however, is further breakdown the totals I have for each category into whether they have an assigned surgery date or not. Within my database those with a date are listed as "A" for active and those without dates are listed as "W" for waitlisted.

Is there some way that I can conditionally count only those with "A" and those with "W" separately within the same details line that I already have the total for? It seems like a simple breakdown, but I can't see the solution.

If there is no Crystal function to do this do you have any other suggestions? Anything on the view/stored procedure side that you can think of? I have used a stoerd procedure with all of the information for both "A" and "W" and have even tried basing my report on two separate views, but when I link them it drops records as I cannot do a full outer join that would return all records for both "A" and "W"; I can only choose one or the other to return all records for.

TIA for your help.

- Shaun
 
According to me create a formula as below
if {field_name} = A then 1 and name it as A
Creat another formula
if {field_name} = W then 1 and name it as W

in the group create a summary field to count 'A' and another summary field to count 'W'

This will count no of A's and no of W's
I hope this works for you

Thanks

 
To add a little clarification, the summary you would use is a sum, not a count, on each of the formulas suggested by Swetal2004.

-LB
 
Thanks to both of you. I had to go back and ungroup my stored procedure, but then I was able to go in and use some formula fields like you suggested and sum them up in different columns to get the info I was looking for.

Thanks again.

- Shaun
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top