Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

capriconuser
New Contributor III

Days difference including holidays qlikview

HI all

here i am trying to get total days including weekend between fromdate and todate.. 

script

 

LOAD Id, 
     LeaveType, 
     OwnerName, 
     Date(CreatedDate,'DD/MM/YYYY') as LeaveDate, 
     Month(CreatedDate) as LeaveMont,
     Year(CreatedDate) as LeaveYear,
     Week(CreatedDate) as LeaveWeek, 
     From as fromdate, 
     To as todate
FROM
L_sheet.xlsx
(ooxml, embedded labels, table is Le25);

 

 this is what i am trying 

 

networkdays (Leaves.From,Leaves.To)

 

but here i get days without weekend.. 

 

Capture.JPG

when i do just

 

(Leaves.From - Leaves.To) 

 

 

then i get  this 

Capture.JPG

 

whereas i want include weekend days also .. 

 

how i do this 

 

Labels (2)
8 Replies
Highlighted
mahaveerbiraj
Contributor II

Re: Days difference including holidays qlikview

hi try this,

 

 

fabs(FLOOR(Interval(Date(Leaves.From,'DD-MMM-YYYY') - date(Leaves.To,'DD-MMM-YYYY'),'d')))

 

Highlighted
MVP
MVP

Re: Days difference including holidays qlikview

Instead of  From - To, I guess you need To - From, i.e.

(Leaves.To - Leaves.From)

 

Highlighted
capriconuser
New Contributor III

Re: Days difference including holidays qlikview

then this shows me only negative numbers.. nothing changed

Highlighted
capriconuser
New Contributor III

Re: Days difference including holidays qlikview

@tresesco  i mean nothing changed i still did not get whole date using this approch 

leaves.to - leaves.from

Highlighted
capriconuser
New Contributor III

Re: Days difference including holidays qlikview

@mahaveerbiraj  still nothing changed .. still i did not get some data using this approch

Highlighted
MVP
MVP

Re: Days difference including holidays qlikview

If you use:  =leaves.to - leaves.from

how does your output look like? Also let know your expected output.

Edit: In the meanwhile, you can try below as well:

=Interval(leaves.to - leaves.from, 'D'

Highlighted
capriconuser
New Contributor III

Re: Days difference including holidays qlikview

@tresesco  the output which i already posted in 2nd picture in question

Highlighted
MVP
MVP

Re: Days difference including holidays qlikview

Try to add two more expression in your chart, like:

=leaves.to - leaves.from   

 and

=Interval(leaves.to - leaves.from, 'D')

and share the output (screen shot) for them. Or, try to share your sample app.