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

Help with group totals 1

Status
Not open for further replies.

BlurredVision

Technical User
Aug 6, 2001
326
GB
Hello All.. I sure hope someone can help me out here.

I have the following information within my report

Group Header #1: (Specialty)
Detail Section: (Process_ID)

So, the data in the report looks like this

Cardiology
1234
Internal Medicine
59
373
1234
Neurology
34
79
Pediatrics
376

I then do a count of the process_id,

My problem is, I have duplicate records within the groups (Example here would be 1234) Is there a way I can remove one of the groups that has the duplicate record.. It only needs to be counter once.

I am using Crystal Reports 10 against an oracle 9i db

Thanks you very much for your time.



 
Can be done but is messy. Create a running total that does a distinct count of the process field. Then put this formula on the details band:
Code:
WhilePrintingRecords;
   NumberVar Prior;
   BooleanVar Repeat:=false;
   if {#CaseCount} <> Prior + 1 //which indicates a first record for this customer
   then Repeat := True;
   Prior := {#CaseCount};  //store the current count to compare with next record
   Repeat

This will give you a True/False value that shows if a record is a repeat. You can use this value or the pattern to both suppress the dup record or to increment a running total using variables.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides for Formulas, Parameters, Subreports, VB, .NET, Tips and Tricks
 
Wonderful Ken!.. How the heck did you come up with that? Thanks again, it worked out great..
 
I didn't just make it up. This is going into Volume III (still being written) of my "Expert Techniques" series. I use it to do a "Distinct Sum", which is a sum of one column based on distinct values in another column, whenever the duplicates are not consecutive.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top