Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
capriconuser
Creator
Creator

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
mahaveerbiraj
Creator II
Creator II

hi try this,

 

 

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

 

tresesco
MVP
MVP

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

(Leaves.To - Leaves.From)

 

capriconuser
Creator
Creator
Author

then this shows me only negative numbers.. nothing changed

capriconuser
Creator
Creator
Author

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

leaves.to - leaves.from

capriconuser
Creator
Creator
Author

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

tresesco
MVP
MVP

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'

capriconuser
Creator
Creator
Author

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

tresesco
MVP
MVP

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.