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!

Variable problem showing 50% reduction or greater 2

Status
Not open for further replies.
Jul 13, 2002
36
US
Database type: ODBC, Crystal version 9.0

This is what I need to do. We have patients who come in periodically to take a test which shows a numeric score. I need to run a report which shows me those patients who have accomplished a 50% or greater reduction in scores between concurrent tests. I have the report grouped by patient account ID. I believe this will be accomplished with a variable but don't know how to set it up.

Technonurse-Spokane
 
I'd do it by suppressing every record except where the same patient has a reduced score.

Right-click on the detail section and choose Format Section. Then choose the formula icon (x+2 and a pencil) for suppression.
Code:
{Patient} <> Previous({Patient})
or
({Testscore}*2) > Previous({Testscore})

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Do you want to see customers who at any time showed a reduction greater than 50% from one test to the next, or do you only want to look at their two most recent tests? To show a list of those people who had a reduction of more than 50% in their two most recent tests, use a suppression formula like the following on the detail section:

(
{table.testdate} = maximum({table.testdate},{table.acctID}) and
{@reduction%} < 50
) or
{table.testdate} <> maximum({table.testdate},{table.acctID})

...where {@reduction%} is a formula:

if next({table.acctID}) = {table.acctID} then
((next({table.testscore})-{table.testscore})/next({table.testscore}))*100 else 0

If you just want to show those with any reduction of 50% or more then use a suppression formula of:

{@reduction%} < 50)

-LB
 
Thanks, guys. I used both of your inputs. I've never used the "previous" or "next" notations before in a formula. This helped me out a lot. Technonurse

Technonurse-Spokane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top