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!

CR Subtotalling AT A GROUP--apart from Sum of Detail records?

Status
Not open for further replies.

gal

Programmer
Mar 5, 2002
25
US
Hi, lbass and other stars! Is there a way of "Subtotalling At A GROUP level" for # Beds available, while subtotalling for # Patients detail records at the same group level? I have to calculate subtotals at 4 group levels. At each group level I will report Bed Capacity, Number of Patients, and Patient Utilization (Number of Patients/Bed Capacity). Bed Capacity comes from a file that has a fixed Bed Capacity assigned to each Unit, that can be rolled up into total per Program, etc., for each of the 4 group levels. The problem is the bed capacity is not dependent upon the number of patient detail records--However, the linking/grouping structure of the Crystal Report automatically assigns each patient a Bed Capacity, so that the subtotal of Bed Capacity is exaggerated. Is there a way of "Subtotalling At A GROUP" only for the Bed Capacity? I will need to display it and use it in the Patient Utilization (Number of Patients/Bed Capacity)calculation at the same group level. Thank you in advance.
 
One way to calculate the bed capacity is to use running totals. For each group level, you would create a separate running total where you select {table.bedcapacity}, sum, evaluate on change of field {table.unit} or on change of group (if you are grouping on unit), reset on change of group (the group you are currently summarizing). If you use "on change of unit", be sure you are using {table.unit} as your sort field.

You can then use the running total in formulas at the particular group level, as in:

distinctcount({table.patientID},{table.program})/{#bedsperprogram)

By the way, you will get more responses if you do not direct your questions to any particular forum member. You never know who will come up with the right answer, and there are many very talented people here who are not on the MVP list.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top