Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
madnanansari
Creator
Creator

Peek is slow. Any workaround?

I am working on Employee Attendance data.  The attendance data has Employee Id, Attendance date, Date & Time In and Date & Time Out.

My requirement is to make a table where I list all the hours when an Employee is present. That means if an employee punches in at 8Am and Punches out at 5PM; I need the below hours in my employee attendance hours table:

8

9

10

11

12

13

14

15

16

17

When I write the code; I use the Peek function in a do while loop at it takes more than an hour to parse 100 thousand records. Is there any workaround to speed up the code?

 

 

Labels (1)
12 Replies
madnanansari
Creator
Creator
Author

Hello Arnado,

I am working on a supermarket data which works 24x7 so Some people shift starts at 7Am and some in the evening at 7PM. If you can change the code accordingly?

ArnadoSandoval
Specialist II
Specialist II

Hi @madnanansari 

You should describe your problem trully, without leaving any details out; I don't understand why you did noy try to extended the application I attached (Z_Attendance_01.qvf) one of the Qlik Community functions is to guide developers like you to understand and learn the product; this is not a "Hire a Qlik Developer" Community, if that is what you are looking for, post your question in those sites the offer "Developers for Hire".

Now going back to your question, as I already upload the application: Z_Attendance_01.qvf  Would you please ask a question based on where in its script you are experiencing difficulties? or clearly ask for the application to be fully written for you?

hth

Arnaldo Sandoval
A journey of a thousand miles begins with a single step.
thi_pham
Creator III
Creator III

I think you could make a join between 2 tables:

Temp:

Load Date, Hour resident date_hour;

output join

Employee Id, Attendance date, Date , TimeIn,TimeOut;

 

Data:

Noconcatenate

Load *, 

if (hour >=TimeIn and hour <=TimeOut, 1, 0 ) as IsBuildHour;

resident Temp;

 

Use column IsBuildHour = 1 to get your result.