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

Formula to NOT suppress duplicates

Status
Not open for further replies.

mjm19

Technical User
Apr 22, 2003
33
US
Using the format editor, it is easy to click on suppress if duplicated. However in this report, I only want to see duplicated values. A dialy query runs giving me all the data I need from the previous days lab results from a hospital. In this particular case, I'm searching for this:

{Query.Result} in ["ABNL", "AUTOA", "NORMAL", "NSA"] and
{Query.TestCode} in ["DIFIS", "MRCM"]

I get a separate record for each Test Code. So all I simply want to do is get those instances where a patient has both these tests with any of the chosen results. I get hundreds of instances of one or the other test code appearing on the report (each patient gets a unique accession number):

AccNumber Test Code Result

M12345 DIFIS AUTOA
M64789 DIFIS NORMAL
M33333 DIFIS AUTOA
M33333 MRCM NORMAL

I would only want to capture the M33333 patient.

Thnaks for any help.








 
For Crystal 8.5, you could do it as follows:

a) Group by AccNumber
b) Do a summary count within the group (right click, [Insert] and [Summary]
c) For the group header, footer and detail lines, suppress if the summary account is 1.

This has the drawback that the non-duplicated values are still there, but they will not be shown.

Madawc Williams
East Anglia, Great Britain
 
Just to add a little clarification, I think you'd want to use distinctcount for the summary:

distinctcount({test.code},{table.acctno}) = 1 //for the suppression formula

Or you could also use a group select statement:

distinctcount({test.code},{table.acctno}) > 1

In either case you'd need to use running totals to count the number of patients with both tests. In the case of suppression, you would need to add the suppression criteria as the "evaluation based on formula section."

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top