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

Exclude records based on summary field in group

Status
Not open for further replies.

ajhess

Technical User
Jul 27, 2012
18
0
0
US
I'm looking for suggestions on how to exclude records from summaries and crosstabs based on another summary field. We have a lot of scenarios where a cost center will post a charge incorrectly onto a patient's record, which is then subsequently reversed. The initial post & reversal exist on the database, and therefore are returned in my queries.

A typical example is a patient in the Details section with charges in multiple cost centers, one of which has a reversal that nets the cost center to 0. Yet when I group the cost center and do a distinct count of patients, that cost center will still have a value of 1.

Using the Group Select Expert to set the 'sum of charges <> 0' works fine for that group, but that won't work for some higher group levels... I also will often put crosstabs into the Report Footer, which will always count those patients since they exist in the details section.

Hopefully this is clear, any ideas? Thanks in advance
 
Are there no other fields in the record which indicate the transaction is a reversal? And, if your lucky, an indication of which transaction the reversal was applied to? If so you could use selection expert to avoid selecting those records at all.



_____________________________________
Crystal Reports 2011 and XI
Intersystems Cache 2012 ODBC connection

 
You can use a variable in the cost centre group footer, if you do not want to see this group just suppress.

@CCentre Count// place this in CCentre group footer
whileprintingrecords;

global numbervar ccentre;

If Sum(valuefield, costcntrefield) <> 0 then ccentre:= ccentre+1;

@CCentre Display// place this in report footer
whileprintingrecords;

global numbervar ccentre;

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top