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!

Running Total Issue Crystal 11

Status
Not open for further replies.

kezdawg

Programmer
Apr 2, 2008
19
GB
I am trying to figure out something which should be very simple (I would have thought).

Group Header 1 Region North
Group Header 2 Patient Gender Male
Group Header 3 Age Group 25-34
Group Header 4 Patient Episode * W074412/05/2007
* patient episode is a combination of patient id and attendance date)
Details Code A
Detail Code B
Detail Code C


What I want to do is create a running total to count a patient episode but only if one of the codes in that episode <> AAA


So in scenario 1

Detail Code AAA
Detail Code BBB
Detail Code CCC

Running total would add it as 0 as it has this set of patient episode data contains the code AAA

Scenario 2
Detail Code BBB
Detail Code CCC
Detail Code DDD
Detail Code EEE

Running total would add it as 1 as this set of patient data doesn’t have a Code AAA
----------------------------------------------------------------------------------------------------

I can create a running total at the Age Group Level and it seems to work fine. But when I create a running total of the total at the gender level it doesn’t add up for the column B.
Col A Col B
Ie With Code A Without Code A

Male
15 and Under 5 3
25-34 6 7
35-44 7 5
Male Total 18 + 16(ie incorrect)
+ (this totals up ok but not using a distinct count)

I have tried using running totals and then creating arrays that adds all the Codes per Patient Episode and then try and exclude any that have AAA in the result and an array counter but all to no avail.

Runnign totals i was using distinct Counts of PAtient Episodes(and i am therefore need a way to do a sum of the distinct counts)

Maybe its something silly I haven’t thought of.

Any help would be much appreciated.
 
Create a formula:

//{@AAA}:
if {table.code} = "AAA" then 1

Then set up the running total to do a distinct count of episode, evaluate on change of formula:

sum({@AAA},{table.episode}) = 0

If at a group level, reset on change of that group; if at the report level, reset never (using separate running totals obviously).

-LB
 
Lbass your a saviour. Man it was so simple and i was starting over complicate it using arrays etc. In a second you fixed it up for me. Thanks a bunch !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top