Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
D19PAL
Creator II
Creator II

find out the future date by number of networkdays

Hi,

I got a date field in my data model, I want to calculate 10 working days from that date in date format in the script.

 

Many thanks.

 

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Qlik has a function for you. Try LastWorkDate().

View solution in original post

5 Replies
rubenmarin

Hi, if working days are from monday to friday it would be like adding 13 days to date field (or 14 if you don't want to count the date field itself): Date(DateField+13) as NewDateField

If you want to add holidays you can use NetworkDays, so the final calcualtion could be:

(Datefield+13)+(10-Networkdays(DateField, DateField+13, [HolidaysDates]))

https://help.qlik.com/es-ES/sense/August2021/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeF...

D19PAL
Creator II
Creator II
Author

I've done some test in excel using your method and I dont think it will work as hard coding the days 13 or 14 as those numbers change depending what day the date is,.

This monday for example will be 12 days and Tuesday will be 14 days, so how will hardcoding the days work? I want that but to be worked out by Qlik and then show me the date of that.

 

Mind you I haven't tried your way in qlik sense yet, because I don't think the first bit is right.  I'm so sorry if it is, I'll try it now, doesn't work.

 

tresesco
MVP
MVP

Qlik has a function for you. Try LastWorkDate().

D19PAL
Creator II
Creator II
Author

Perfect, nice function, I like it.