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!

How to display only a sampling of records for each group?

Status
Not open for further replies.

losthorizon

Technical User
Nov 7, 2001
63
US
There is only one group on the report. The group is: multiple / various types of insurance plans. For each plan type that the insurance company offers, of course, there are multiple detail records, based on policies sold (certificates). The boss only wants to view about 3 or 4 records (a very small sampling of certificates) for each plan type. The plan types are "suppressed" in the details section. We want to display the detailed certificate data for each group in GF1. (GH1 is completely minimized). The report is currently giving only one result for each type, but what we want to view is, at least, 3 or 4 certificate results for each of the many plan types. I attempted a "Top N" sort of the plan types, but of course, that only resulted in the Top N plan types showing up in the report. (A 'Top N' of certificates isn't allowed.) We still want ALL of the plan types to show, but only a random sampling of certificate details for each type of plan. How do we go about showing this? We already tried a Parameter that allowed us to enter a detail range, but that didn't help us. Any thoughts?
 
Do a running total to count the records. When it gets beyond a certain total, suppress the detail line. (Suppress formula within Section Format).

I've done this a lot, and the total for the sample can be made a parameter with a default value, meaning that you can change it with a minimum of work.

Madawc Williams
East Anglia, Great Britain
 
Have a look at: faq767-3260

The same approach can be extended to handling "within group" situations.

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Ido, Yes, thanks, but I already did look at that one. We skipped the parameter idea, altogether, and went with Madawc's suggestion. It took our programmer here about 45 minutes to figure it out on his own, along Madawc's same line of thought. Madawc also responded to Thread 149-577624, on "How to show 5 records at a time in detail area", that contains similar thoughts on the subject. We did some preliminary testing against the database using our interface program (the programs we developed here for our clients; the same one's that our fraternal insurance clients see & utilize daily), and it shows promise!
 
Ido's suggestion was in response to your statement that you wanted a "random sampling" of certificate details. You might want to consider using the random function by adding a formula {@random} to your detail section:

rnd()

Sort by {@random} and then add the running total field which counts within groups. Then suppress records with {#countingroup} >= 5 //to get records 1 - 4.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top