Hi everyone.
I'm trying to make a running total formula work, but not getting there...
In my report, I have detail lines containing a date and a number (0 or 1) if a person is sick or not on that date. The details are grouped by personal number. Now what I'm trying to do is to count the frequency of sickness (so not the number of days). I will give some example codes:
nr 68
01/01/2008 0 --> here I want 0
02/01/2008 1 --> here I want 0
03/01/2008 1 --> here I want 1
04/01/2008 0 --> here I want 0
07/01/2008 0 --> here I want 0
08/01/2008 1 --> here I want 1
...
nr 72
01/01/2008 0 --> here I want 0
02/01/2008 0 --> here I want 0
03/01/2008 0 --> here I want 0
04/01/2008 0 --> here I want 0
07/01/2008 1 --> here I want 1
08/01/2008 0 --> here I want 0
What I tried to do was the following... I make a formula field with the following:
IF ONFIRSTRECORD THEN
0
ELSE
IF {T6003.TPZIEK} = 1 AND NOT ONLASTRECORD THEN
IF NEXT({T6003.TPZIEK}) = 1 THEN
0
ELSE
1
ELSE
IF {T6003.TPZIEK} = 1 AND ONLASTRECORD THEN
1
ELSE
0
But the problem is that when the field has a 1 value on the last detail record of the group and the first detail record of the next group also contains a 1, the last record gives a 0 instead of a 1.
Can somebody help me with this. If you need more info, more examples, ... please ask.
Thanks alot,
FatEric
I'm trying to make a running total formula work, but not getting there...
In my report, I have detail lines containing a date and a number (0 or 1) if a person is sick or not on that date. The details are grouped by personal number. Now what I'm trying to do is to count the frequency of sickness (so not the number of days). I will give some example codes:
nr 68
01/01/2008 0 --> here I want 0
02/01/2008 1 --> here I want 0
03/01/2008 1 --> here I want 1
04/01/2008 0 --> here I want 0
07/01/2008 0 --> here I want 0
08/01/2008 1 --> here I want 1
...
nr 72
01/01/2008 0 --> here I want 0
02/01/2008 0 --> here I want 0
03/01/2008 0 --> here I want 0
04/01/2008 0 --> here I want 0
07/01/2008 1 --> here I want 1
08/01/2008 0 --> here I want 0
What I tried to do was the following... I make a formula field with the following:
IF ONFIRSTRECORD THEN
0
ELSE
IF {T6003.TPZIEK} = 1 AND NOT ONLASTRECORD THEN
IF NEXT({T6003.TPZIEK}) = 1 THEN
0
ELSE
1
ELSE
IF {T6003.TPZIEK} = 1 AND ONLASTRECORD THEN
1
ELSE
0
But the problem is that when the field has a 1 value on the last detail record of the group and the first detail record of the next group also contains a 1, the last record gives a 0 instead of a 1.
Can somebody help me with this. If you need more info, more examples, ... please ask.
Thanks alot,
FatEric