Hi, I'm using XI and connecting to a SQL Server 2000 database. I'm not sure if I'm using the most efficient method to get my answers and I'm stumped as to how to make this work.
Problem:
In the sample data below, the Count field is a running total which resets on the change of a group. The 2nd Consec field is a formula which tells me when a patient has hit the therapeutic range we're looking for. What I'm looking for is the number of time we had to test before we hit the therapeutic range.
I tried this formula:
but I get the following error: "This field has no previous or next value".
Is there a different way of getting this value? In the example below, the correct value is 8 (the patient was in the therapeutic range when the 9th test was taken so we know that it took 8 "attempts" to get there).
Problem:
In the sample data below, the Count field is a running total which resets on the change of a group. The 2nd Consec field is a formula which tells me when a patient has hit the therapeutic range we're looking for. What I'm looking for is the number of time we had to test before we hit the therapeutic range.
I tried this formula:
Code:
If {@2nd Consec} = "yes" Then Previous({#Count})
Else
0
Is there a different way of getting this value? In the example below, the correct value is 8 (the patient was in the therapeutic range when the 9th test was taken so we know that it took 8 "attempts" to get there).
Code:
Name Collection DTTM Result Range? Count 2nd Consec
AAAA 3/28/2005 7:25:00AM 200 N 1 no
AAAA 3/28/2005 3:46:00PM 75 Y 2 no
AAAA 3/29/2005 6:00:00AM 61 N 3 no
AAAA 4/1/2005 4:45:00PM 66 N 4 no
AAAA 4/2/2005 1:09:00AM 65 N 5 no
AAAA 4/2/2005 9:30:00AM 176 N 6 no
AAAA 4/2/2005 3:50:00PM 108 Y 7 no
AAAA 4/3/2005 5:35:00AM 112 N 8 no
AAAA 4/3/2005 2:15:00PM 84 Y 9 yes
AAAA 4/4/2005 5:40:00AM 79 Y 10 yes
AAAA 4/5/2005 5:50:00AM 101 Y 11 yes
AAAA 4/6/2005 5:10:00AM 109 Y 12 no
AAAA 4/7/2005 6:45:00AM 119 N 13 no