Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
realpixel
Creator
Creator

Time attendance

Hello,

I need to calculate total time between the first hours and last hours

In my chart, I use these expressions

First Hours = min((heure),1)

Last Hours = Max(heure)

Total Work = =if(CalendarWeekDay='sam.',Interval(Max(heure)-Min((heure),1)),Interval((Max(heure)-Min((heure),1))-MakeTime(2),'hh:mm:ss'))

It's works fine for all employees working in normal hours like 07h AM to 07h PM but I have a problem with all employees working at night like 07h PM to 07h AM (next day). I think this problem is due to the calendar selection.

I have two shift from

- 07h AM to 07h PM

- 07h PM to 07h AM

For example if I do a selection by date for the 04/20, in my chart the first hour is 05:32:59 AM and the last is 19:01:43 PM but the correct time should be first hour 19:01:43 PM and last hour 05:38:12 AM the next day (04/21).

Someone have an idea to solve my problem?

Labels (1)
1 Reply
pokassov
Specialist
Specialist

Hello!

I think you have to tie date and shift time. So difference will be not between time but between datetime (timestamp)

Segey