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

Formula for 2 variables with specific results

Status
Not open for further replies.

mjm19

Technical User
Apr 22, 2003
33
US
Need a formula to accomplish the following:
If the patient has results for test A AND test B AND the result for test A = X AND the result for test B can be either L,M or N then display on a report.
The key here is that the patient has had requests for both tests A and B. No matter what I do, I come up with ALL instances for either test A or test B regardless if on the same patient or not. So instead of 4 hits today, I'm getting 540.

Thanks for any help.
 
describe how your report is set up...what are you trying to accomplish? Are you just trying to decide how to display this field? Are you trying to restrict the number of records retrieved?

If it is the latter, you will have to set up parameters of some kind...then it is a relatively easy record selection formula based on user input.

If it is display of a certain field then a formula can be created in the conditional suppress of that field easy enough...

You really haven't described your report

Jim Broadbent
 
I think you could do something like the following. I don't know what your fields are, so I'll assume you have a test type field and a results field. For your record select statement use something like:

({table.test} = "A" and
{table.results} = "X") or
({table.test} = "B" and
{table.results} in ["L","M","N"])

Group on {table.client} and then go to report->edit selection formula->GROUP and enter:

distinctcount({table.test},{table.client}) = 2

This will return only those clients who have results for both tests.

-LB
 
Thanks LB ... you made my day. The Group selection formula is what I was missing. Thanks again ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top