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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Do I Capture 3 Consecutive Absences? 1

Status
Not open for further replies.

Sange

Technical User
Jun 10, 2002
85
AU
Hi, I am developing a report in CR10 and need to capture any person who has missed 3 consequtive days of community work with the status "Absent No Contact".

I have grouped the report by community work site and then person id. As a result the data looks like this:

ABC PARKLANDS
PERSON_ID: 123456
Id Start Date/Time End Date/Time Status
1 08/10/11 08:00 08/10/11 16:00 Attended
2 09/10/11 08:00 09/10/11 16:00 Absent No Contact
3 15/10/11 08:00 15/10/11 16:00 Absent No Contact
4 16/10/11 08:00 16/10/11 16:00 Absent No Contact
5 20/10/11 08:00 20/10/11 16:00 Attended

PERSON ID: 258979
7 03/10/11 08:00 09/10/11 16:00 Absent No Contact
8 04/10/11 08:00 09/10/11 16:00 Absent No Contact
9 17/10/11 08:00 09/10/11 16:00 Attended
9 18/10/11 08:00 09/10/11 16:00 Absent No Contact

In these two examples, only the first Person Id would be flagged as having 3 unacceptable absences.

I tried a running total however this didn't quite achieve what I was hoping for. I'm thinking I may need to use a variable but not sure how to get this to work.

Any assistance would be appreciated.

Thanks
 
If you just want to identify people who meet the criteria, you could do this in the group footer, by use a formula like this:

whileprintingrecords;
numbervar cnt;
booleanvar flag;
if {table.status} = "Absent No Contact" then
cnt := cnt + 1;
if cnt = 3 then
flag := true;
if {table.status} = "Attended" then
cnt := 0;

Add a reset formula to the group header:
whileprintingrecords;
numbervar cnt;
booleanvar flag;
if not inrepeatedgroupheader then (
cnt := 0;
flag := false
);

In the group footer, add a formula:

whileprintingrecords;
booleanvar flag;
if flag = true then
"3 Unacceptable Absences"

If you actually want to suppress unflagged people, you would need to save the report as a subreport which you would insert in a group header_a. You would then create a shared variable for the flag variable and then pass that to the main report in order to suppress sections where the flag is false.

-LB
 
Hi LB, I'm not quite sure how this works but it does! The first formula keeps displaying zero in the actual report but then the group footer formula will in fact display if the absence is unacceptable. Wonderful. Thanks so much.
 
You can suppress the group header and details formulas.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top