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.
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.