Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

I have 2 date fileds like.

I have 2 date fileds like.

date                 today's

12-1-2016        5-2-2016

1-1-2016          5-2-2016

I want calculate the range of two fileds and that range count doesn't calculate the weekends dates.

example:

date                      today's                range

12-1-2016             5-2-2016              19

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Networkdays(date, today())


talk is cheap, supply exceeds demand

View solution in original post

10 Replies
Gysbert_Wassenaar

Networkdays(date, today())


talk is cheap, supply exceeds demand
sathishkumar_go
Partner - Specialist
Partner - Specialist

Hi,

Try this

Test:
LOAD * INLINE [
Date, Todays
12-1-2016, 5-2-2016
1-1-2016, 5-2-2016
]
;

Test1:
load
*,
networkdays (DATE#(Date,'DD-M-YYYY'), DATE#(Todays,'DD-M-YYYY')) as Test2
resident Test;

drop table Test;

--Sathish

Not applicable
Author

Thank you so much Gysbert.

I want to remove some holidays and special dates in the calculations. ...can u pls..help me fst..

Gysbert_Wassenaar

The NetWorkDays function accepts a list of dates as third, fourth.... nth parameter. You can use that to except that list of dates from the calculation of the net work days between a start and end date. Just add your holidays and special dates as additional parameters to the NetWorkDays function.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert,

can u give me one sample expression.

I wrote expression like this.

networkdays(date,today(26/01/2016)). its  showing correct value.

how can I add 2 more dates in that expression...

Thanks,

Kumar.@@

Gysbert_Wassenaar

See this document: Find Net Working Days


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you so much Gysbert.

varshavig12
Specialist
Specialist

Network

T1:

load * inline [

date             

1/12/2016,              

];

load networkdays(date,today(),'1/26/2016','1/27/2016') as noOfDays

resident T1;

note: the bold part is optional( for holidays)

oknotsen
Master III
Master III

If your question is now answered, please flag the correct answer with Correct Answer. If not, please make clear what part of your question you still need help with.

May you live in interesting times!