Report Design
 Crystal Reports Forum : Crystal Reports .NET 2003 : Report Design
Message Icon Topic: Counting a number range and adding a score Post Reply Post New Topic
Author Message
brreid
Newbie
Newbie
Avatar

Joined: 19 Mar 2007
Online Status: Offline
Posts: 11
Quote brreid Replybullet Topic: Counting a number range and adding a score
    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
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet 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
IP IP Logged
brreid
Newbie
Newbie
Avatar

Joined: 19 Mar 2007
Online Status: Offline
Posts: 11
Quote brreid Replybullet 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
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.027 seconds.