Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Tally/Score Formula Post Reply Post New Topic
Author Message
Takesen
Senior Member
Senior Member


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 143
Quote Takesen Replybullet Topic: Tally/Score Formula
     Posted: 05 May 2010 at 8:08am
Hey Guys!
Long time!

I'm currently working on this report in which we're trying to basically give a score to our patients based off medications and living status.

Lets just say medications are x, y and z.
And Living statuses are a, b and c

Each of these has a forumula that counts if a patient falls under any of these values.

Formula for "x"
if {medication.brand_name} in ["series of medications that fall under x category"] then
    1
Else
    0
The others follow this same forumla.

so basically what i'm trying to do is something like...
shared numbervar Score := 0;

Sum ({@x}, {@Patient Name}) > 0 then
Score := Score + 1
Sum ({@y}, {@Patient Name}) > 0 then
Score := Score + 1
continuing on.
So for each category they have at least 1 value for.
They gain 1 point to their score.

I'm trying to avoid using an if else statement because it'll force me to create a large array of possibilities. And if I create it in an incorrect order it'll miss some values giving an improper score.

Anyone have any thoughts? My brain seems to be shut down today >.<

Thanks in advance for any help/ideas!
-Takesen

edit: Still using CRXI R2




Edited by Takesen - 05 May 2010 at 8:16am
If IRL is an MMO... I guess we're still in beta...
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 May 2010 at 8:57am

What are the conditions exactly? Do you have a matrix based on differenet Meds? Are you expecting a numeric value to assign an urgancy or critical amount or just a t/f ?

IP IP Logged
Takesen
Senior Member
Senior Member


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 143
Quote Takesen Replybullet Posted: 05 May 2010 at 9:03am
Alright,
so say a person is on Methadone.
that alone gives that person a value of 1.

if they are on an opiate medication (the formula has a series of opiates to review) the person gets an additional point.

Score now = 2.

If they are homeless add 1

Score now = 3

ect.

The formulas tracking if they have any are as posted in previous post.
And I'm using the Sum grouped by person.

Thus if it's a value > 0 it's a point. We are not giving them a point PER med just per category of med.

there score for the final result needs to be a Number. so basically saying a high number score needs to be addressed.

Does that make more sense?

If IRL is an MMO... I guess we're still in beta...
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 May 2010 at 9:20am
So your problem is an issue that all your scoring elements report per row and the meds change per row. So you need to calculate a total not repeating the counts for things like homeless which are on each row but you do want to count only once a category for a particular drug.
First thought is...
I would use RT's for each element setting them to evaluate once per person for all your singular items (like homelessness)
Create an RT for each drug setting as a DistinctCount of the client/person evaluating only when your drug condtion is met.
Then sum all the RTs in a formula and place at the group footer
IP IP Logged
Takesen
Senior Member
Senior Member


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 143
Quote Takesen Replybullet Posted: 05 May 2010 at 9:30am
Well now I feel kinda silly for not thinking about doing that... I'll see what I can do when I step back into the office.
If IRL is an MMO... I guess we're still in beta...
IP IP Logged
Takesen
Senior Member
Senior Member


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 143
Quote Takesen Replybullet Posted: 05 May 2010 at 12:16pm
Success. unfortunately though, I can't figure out away around sorting my reports values based on the Scores because of the patient groupings...
If IRL is an MMO... I guess we're still in beta...
IP IP Logged
Takesen
Senior Member
Senior Member


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 143
Quote Takesen Replybullet Posted: 05 May 2010 at 12:42pm
Bah, Never I'll just make them export it.
If IRL is an MMO... I guess we're still in beta...
IP IP Logged
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