Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I am working on Attendance Tracking system.
And want to find such employees who are Absent for 7 or more consecutive days.(Working days)
I have the following fields in it.
Empid,Date,Status
Status has the values as Present,Absent.Off
How do I proceed to get a solution.
Thanks and Regards,
Priya
Hi
You need something like this:
Load your existing data:
Data1:
LOAD EmpID,
Date,
Status,
...
FROM .....;
Now load from the Data resident
Data2:
LOAD *,
If(EmpID = Previous(EmpID),
If(Previous(Status) = 'Absent' And Status = 'Absent',
Peek('ConsecutiveAbsentDays') + 1,
If(Status = 'Absent', 1, 0)
),
If(Status = 'Absent', 1, 0)
) As ConsecutiveAbsentDays
Resident Data1
ORDER BY EmpID, Date;
Finally drop the first Data table:
DROP Table Data1;
Now you can create an straight table object with Dimension EmpID and expression If(Max(ConsecutiveAbsentDays) >= 7, 'Absent > 7 Days') and ensure that suppress 0 and suppress missing options are on
HTH
Jonathan
Can you upload some sample data.
Can you load your sample data file?
Hello All,
Pls Find the sample data.
Thanks & Regards,
Priya
Hi
You need something like this:
Load your existing data:
Data1:
LOAD EmpID,
Date,
Status,
...
FROM .....;
Now load from the Data resident
Data2:
LOAD *,
If(EmpID = Previous(EmpID),
If(Previous(Status) = 'Absent' And Status = 'Absent',
Peek('ConsecutiveAbsentDays') + 1,
If(Status = 'Absent', 1, 0)
),
If(Status = 'Absent', 1, 0)
) As ConsecutiveAbsentDays
Resident Data1
ORDER BY EmpID, Date;
Finally drop the first Data table:
DROP Table Data1;
Now you can create an straight table object with Dimension EmpID and expression If(Max(ConsecutiveAbsentDays) >= 7, 'Absent > 7 Days') and ensure that suppress 0 and suppress missing options are on
HTH
Jonathan
Try the attached.