Skip to Content

Report to capture patients with certain lab tests

I am trying to write a report to capture only the patients that had certain lab tests done. So for example I need everyone that had test A and they also had tests B,C,D. If I just use the in function of in [A,B,C,D] then I get everyone that had one those tests not the patients that had A and B,C or D. What is the best way to write this in Crystal Reports ?

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Mar 31, 2017 at 11:06 PM

    Hi Curt,

    Using the In function is the same a using an OR comparison. If you use AND then you could potentially give you partial returns as well.

    Have the report get all patients that have Exam A, B, C and D.

    Create a group on patient.

    Suppress the groups that don't contain Exam A, B, C, and D. Now it's a matter of how to determine if all 4 exams were done. One way to do this is to create a formula like:

    If {table.EXAM} In ["A", "B", "C", "D"] Then 
    Else 0; 
    Drop this formula into the Detail section.

    Now you can do a Sum on this formula and drop the summary into the Group Footer.

    Create a Group Selection Formula where the formula >= 4.

    So it should only list patients that have had all 4 exams.

    Good luck,


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 03, 2017 at 04:01 PM

    Brian - I put all of the exams in the report using an 'in' statement. Some patients only have one of the exams, etc....In your post it says to suppress the groups that don't have exam A,B,C,D, How do I suppress those ?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.