Print Page | Close Window

Counting a number range and adding a score

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=20310
Printed Date: 06 May 2024 at 11:41pm


Topic: Counting a number range and adding a score
Posted By: brreid
Subject: Counting a number range and adding a score
Date Posted: 22 Dec 2013 at 7:24am
Hi,
I am trying to create a Crystal report on patients blood pressure readings and give them a score, example if BP is
under 140 the score is 0
if BP between 140 and 160 then the score is 1
if BP is over 160 the score is 2.
I would like it to look like this:

Patient BPSysgtolic#    Score
Joe X      134             0
Paul x     148             1
Jean x     169             2

If anyone have any suggestions I'll really appreciate any help
thank you

-------------
Thanks for sharing the knowledge



Replies:
Posted By: lockwelle
Date Posted: 27 Dec 2013 at 5:29am
because I hate typing...
local numbervar bp:={table.field};
if bp< 140 then
0
else
if bp < 161 then
    1
else
    2

Should work


Posted By: brreid
Date Posted: 21 Jan 2014 at 4:07am
Hi Lockwelle,
it worked!!! thanks for your help.
I used the formula for other report like the example below and it worked just fine. Thanks again.

local numbervar phq9;

if {RPTOBS.obsvalue} < "15"
then phq9:= 0
else
if {RPTOBS.obsvalue} in "15 to 20"
then phq9:= 1 else
if {RPTOBS.obsvalue} > "20"
then phq9:= 2


-------------
Thanks for sharing the knowledge



Print Page | Close Window