# New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Attend QlikWorld 2020 and hear keynote speaker, Malcolm Gladwell. \$300 savings extended to February 9th Learn More
Not applicable

## Need Payroll Help In Qlikview

Dear All

I want a Payroll Help.

OT calculate           OutTime-InTime-Onduty.

Onduty-Working Hour= OT

OT*OTRate= Amount.

!

Condition:

1) If InTime before 8:00AM OT calculate- Before InTime Hour

Example

InTime          OutTime           Onduty        Working Hour       OT        OTRate   Allow O.T     Amount

7:35 AM          7:25PM          11:50          8:00                    3.25       77            1               250

 7:35 AM 7:25PM 11:50 8:00 3.25 77 0               Null
1 Solution

Accepted Solutions
Contributor II

## Re: Need Payroll Help In Qlikview

Hi,

Try this

Data:

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;

*

FROM

[OvertimeCalc.xlsx]

(ooxml, embedded labels, table is TB01);

Regards

Dhruv

3 Replies
Not applicable

## Re: Need Payroll Help In Qlikview

See the attatchment

Contributor II

## Re: Need Payroll Help In Qlikview

Hi,

Try this

Data:

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;

*

FROM

[OvertimeCalc.xlsx]

(ooxml, embedded labels, table is TB01);

Regards

Dhruv

Not applicable

## Re: Need Payroll Help In Qlikview

Hi Ala,

If I understand you correctly, please try my script below

*,

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

;

*,

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

;

*,

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

;

Check,

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

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

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

OtRate

;