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

2 Tests Qualify by Result but Test 3 does not matter ??

Status
Not open for further replies.

mjm19

Technical User
Apr 22, 2003
33
US
Crystal 8.5. Have tables & views made to display the data I want, but this formula escapes me. Doc wants all patients that have a result of Test 1 >60 and Test 2 <100. At the same time he wants to also display Test 3 no matter what the result is.
The criteria for Tests 1 and 2 is straight forward. They both have to exist on the same patient. If by chance Test 3 was ordered on this patient display that as well. So all 3 conditions do not need to be met.
How do I get test 3 on the report ? I don't want to say that all 3 tests need to be ordered in order to qualify for the report. Need to only say that tests 1 and 2 fit the values stated and if by chance test 3 was ordered as well ...display that value too.

Thanks ....You always come through. 6am Sunday morning, and he wants this on his desk Monday by 10.
 
You didn't specify how your fields worked, so I am assuming you have a field for type of test and a second field for test results. Try creating a record selection formula like:

{table.test} in ["Test1","Test2","Test3"]

Group on {table.patient} and then create two formulas:

//{@test1}:
if isnull({table.test}) or
not({table.test} = "Test1" and
{table.result} > 60) then 0 else 1

//{@test2}:
if isnull({table.test}) or
not({table.test} = "Test2" and
{table.result} < 100) then 0 else 1

Then go to report->edit selection formula->GROUP and enter:

maximum({@test1},{table.patient}) > 0 and
maximum({@test2},{table.patient}) > 0

This will only show those patients who have had test1 and test2 with results that meet criteria, and will also show test3 results, if they have had test3.

-LB
 
LB ----Thanks very much. As an FYI the limits defined for tests 1 and 2 displayed correctly, but I did get all test 3 results regardless if they were on the same orders (we sort by accession # ...If accession # B1234 had tests 1,2 and 3 it showed up, but if only test 3 was on accession # Y1234 it showed up as well). No problem, boss actually liked seeing the other results and can sort them out.

Thanks again ...
 
If you have an inner group on {table.accession#}, i.e., if accession# is a group within the patient group, you could then change the group selection formula to:

maximum({@test1},{table.accession#}) > 0 and
maximum({@test2},{table.accession#}) > 0

This would eliminate the test3 results for other accession numbers that don't meet your criteria.

-LB
 
-LB

Your last tip was terrific. Worked perfectly and the report is now concise with all parameters met. Thanks again ....
Someday I'll get it !!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top