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

Networking days in qliksense

Hi All,

I have below table:-

Aspiring_Developer_0-1648713578904.png

Here I am calculating Loggged_Wkg_Days using this logic :-

Netoworkdays(Issue_recd_date_new, Loggged_Date_new) 

The output is giving me extra result. For instance:-

Feb 2022

Issue recd date is 21/02/2022(21st feb-Monday) and logged date is 28/02/2022 (28th feb-Monday)

So ideally network days should be 5 (excluding Saturday sunday). However it is giving me 6 which is not correct.

I am not able to understand why it is giving me additional records. Can anyone please help ?

Thanks in advance 

@sunny_talwar @Kushal_Chawda @swuehl 

Feb 2022- the issue was recd on 

Labels (1)
1 Solution

Accepted Solutions
brunobertels
Master
Master

Hi 

so 

what about 

Netoworkdays(Issue_recd_date_new, Loggged_Date_new) -1  

 

View solution in original post

6 Replies
brunobertels
Master
Master

hi 

have a look in the main script for this variable may be : 

SET FirstWeekDay=0;

try to set 0 or 1 and see what the function return. 

 

Aspiring_Developer
Creator III
Creator III
Author

Hi @brunobertels 

 

Thanks for your quick response.

I tried it. I changed it from 0 to 1 but it didn't worked.

 

Thanks

brunobertels
Master
Master

Hi 

so 

what about 

Netoworkdays(Issue_recd_date_new, Loggged_Date_new) -1  

 

Aspiring_Developer
Creator III
Creator III
Author

Hello @brunobertels 

Thanks a lot ! 

Iswarya_
Creator
Creator

Hi,

The networkdays function returns the number of working days (Monday-Friday) between and including start_date and end_date taking into account any optionally listed holiday.

So this is because  logged date is 28/02/2022 (28th feb-Monday) and networkdays function takes the Monday so one more extra day is causing value as 6

swuehl
MVP
MVP

Just subtracting 1 from the networkdays() result may lead to other problems.

calculate the working days from 20/02/2022 to 27/02/2022 (sun - sun) will return 4, while I think you would expect 5.

It might be better to explicitely tell Qlik if you want the last or first date not to be considered in the calculation, by adding one to the start date or removing 1 from the end date in the function arguments.

Or maybe 6 working days are correct, if the issue persists from Mon to Mon, and you can't tell the exact hours.