cancel
Showing results for 
Search instead for 
Did you mean: 

Excluding Entire Group if it has a combination of two values

Former Member
0 Kudos

Good Morning all,

I am currently working on a crystal report that groups by patient account number. Under the group, the detail has charge code number. I am trying to exclude or suppress any patient account number that has both charges code numbers 87 and 89. The patient would have to have both 87 and 89 to be excluded, if the patient has only 87 or only 89 then the patient will still show in report. Please see below for an example

Patient155

89

81

83

87

80

Patient 156

87

80

81

Patient 157

87

89

80

82

In this example I would like to only exclude Patient 157 because all though Patient 155 and Patient 156 have either 87 or 89, Patient 157 has both charge code 87 and 89.

Please help.

Thank you

Accepted Solutions (0)

Answers (1)

Answers (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Israel,

A better solution would be to filter out such records at source using a combination of alias tables and selection formula however, here's an easy one for now:

1. Create a formula @Codes with this code:

If {Charge Code} = 87 then 1 else if {Charge Code} = 89 then 3 else 2

2. Go to the Report Menu on top > Selection Formulas > Group and use this code:

NOT(Minimum({@Charge Code}, {Patient Field}) = 1 AND Maximum({@Charge Code}, {Patient Field}) = 3)

-Abhilash