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

Turning off Group Selection or Sub Report?

Status
Not open for further replies.

jaybar48

Technical User
Feb 16, 2002
61
US
I have written a report where I use group selection to get the values I need for the "numerator". In order to compute the values I need for the "denomitator", I need to remove the group selection criteria. Is there a way of turning off group selection in the main report or do I need a subreport. If I need a sub-report, how do I pass the parameters, so I dont have to enter the values multiple times. I am new to sub-reports. Thanks in advance.


Jay
 
For Crystal 8.5, you create a Subreport using [Group] on the Insert menu. You link using [Subreport Links] under [Edit]. You can choose to pass any field that would be availabel in the section where you place the subreport.

If you need to handle the same data with different selection, then a subreport is a good method. You put it in the report header or report footer, since you only need it once. This is much quicker than subreports in detail sections, which do slow the whole report.

It's not clear to me what you're trying to measure. Would a Running Total be another and simpler solution? Or a group that the report produces but then suppresses using the section suppress options?

Madawc Williams
East Anglia, Great Britain
 
Thanks Madawc-


Here is what I am doing.



Within each healthcase agency, I have a group of patients. Each patient has a patient.Id_no as the key field in their patient information record. The patient also has a visit table. The visit table also has the same id field for each visit the patient has (visit.ID_No) Both tables are linked in a one-to-many relationship. A patient can have multiple visits or a single visit.

I grouped first by agency and then by by the visit.ID_no field and used group selection to give me all the all the patients for each agency, where the running total of visits was >1 (more than a single visit for that patient). That is my "numerator". The problem is how can I calculate the "denominator" which is the total number of patients with at least one visit.


Is there a way to do this w/o group selection? If not do I need a sub report and where would I place it?
 
You can put a subreport in the report footer, if you just want to run it twice. You can also save your reort under another name, import it as a subreport and then change it. If I've understood you correctly, you need to do two different sorts of grouping on the same data. That normally means a subreport in Crystal.

Madawc Williams
East Anglia, Great Britain
 
I think you can do this without subreports. For the "numerator", create a running total {#cnt>1visit} by selecting {visit.ID_no}, distinctcount, evaluate using a formula:

count({visit.ID_no},{visit.ID_no}) > 1//where {visit.ID_no} is the group 2 field and is the same as the patient ID_no (if I'm understanding you correctly)

Reset on change of Group 1 (Agency).

I'm guessing you're looking for a percentage of clients who make more than one visit within each agency. Create a formula {@percent>1}:

{#cnt>1visit} % distinctcount({visit.ID_no},{table.agency})//where {table.agency} is your group1 field.

This formula would need to be placed in the group 2 (visit.ID_no) footer.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top