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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How i calculate Overtime

Dear All,

I want to overtime calculation Check 1= overtime OK other wise overtime not allow so how i calculate OT*OTRate= overtime.

Note: OT calculate If InTime<8:00 OT Calculate=8:00.

6 Replies
sujeetsingh
Master III
Master III

Come in more words please

Not applicable
Author

come up with little bit clear

senpradip007
Specialist III
Specialist III

As per your excel overtime(OT) are bit confusing. Where Onduty is 8hr54min OT is 0 and OT is 2hr58min when onduty is 11hr58min. So your OT calculation is bit confusing.

Not applicable
Author

Please Sent just logic then i create the Qlikview

Condition:

1) OutTime-InTime= Onduty

2) Onduty-9: Hours= OT

3) IF Check=1 then he have OT

4) OT*OTRate= OTAmount,

Not applicable
Author

Hi Ala,

If I understand you correctly, please try my script below

LOAD

  *,

  if([Check] = 1,(interval(interval#(OverTime,'hh:mm'),'hh:mm') * [OtRate]) * 24,'No OT') as OTAmount

;

LOAD

  *,

  Interval([OnDuty] - [WorkingHrs],'hh:mm') as [OverTime]

;

LOAD

  *,

  Interval([Out] - [In],'hh:mm')  as [OnDuty]

;

LOAD

  Check,

  time('09:00:00','hh:mm' )  as WorkingHrs,

  time(In,'hh:mm' ) as In,

  time(Out,'hh:mm' ) as Out,

  OtRate

;

LOAD * INLINE

[Check,In,Out,OtRate

1,05:30:00,20:00:00,5

0,05:30:00,18:00:00,8

1,09:00:00,19:00:00,8

];

-Charles

djsampat
Creator II
Creator II

Hi,

Try this

Data:

LOAD *,

  interval(if(Check, rangemax(0,Time-3/8),0)) as OverTime,

  interval(rangemin(3/8,Time)) as RegularTime;

LOAD *, interval(frac(OutTime) - frac(InTime)) as Time;

LOAD

*

FROM

[OvertimeCalc.xlsx]

(ooxml, embedded labels, table is TB01);

If this helped you, please mark as Helpful. If it solves your issue, please mark as Answer

Regards

Dhruv