This field is required.
Only these extensions are allowed(.jpg, .JPG, .jpeg, .JPEG, .gif, .GIF, .png, .PNG)
Tags cannot contain the characters ' /, \\, #, ?, or ; >,< '
Only these extensions are allowed(.zip,.ZIP,.pdf,.PDF,.qvf,.QVF,.qvw,.QVW)
Discussion Board for collaboration related to QlikView App Development.
How can I create networkdays by ignore weekend as holidays? All holidays (weekend and Public Holiday) will be identified manually.
Sample Load Script:
set Holiday= '01/05/2018','22/05/2018','24/05/5018','19/5/2018';
load distinct * Inline [
LOAD Distinct *,NetWorkDays(start, end,$(Holiday)) as networkday Resident Period;
DROP Tables Period;
From the above script, networkday is showing 18 instead of 24 (28days - 4 holidays)
Can anybody help me how to get the result for networkdays = 24?
Please try this one.
Set Holiday= "'01/05/2018','22/05/2018','24/05/2018','19/5/2018'";
ID, start, end
A1123, 01/05/2018, 28/05/2018
A1145, 08/05/2018, 20/05/2018
B3266, 19/05/2018, 23/05/2018
Load * inline [
Load *, if (Holiday >=start and Holiday<=end ,1 , 0) as Holiday_Count
drop table Period;
Load ID, start, end,sum(Holiday_Count) as Holiday_Count
group by ID, start, end;
drop table Period1;
Load *,Interval(end - start, 'D')+1 - Holiday_Count as WorkingDays resident Period12;
drop table Period12;
View solution in original post
The networkdays function returns the number of working days (Monday-Friday).
You can use the Interval function, it will shows the days between 2 dates.
Interval(end - start, 'D')
then minus the holidays
Interval(end - start, 'D') - $(Holiday)
thx Sibin for your reply.
I already used your suggested formula but the result return as below. May be you have other solution for me to get networkday result as 24.
Please use the below script.
Let Holiday_Count =if(len(Holiday)=0,0,
Load *,Interval(end - start, 'D')+1 -$(Holiday_Count) as test resident Period;
Thx for the good trick Sibin. It very useful for my other project.
Actually for the purpose of discussion, I got a different date range for Start and end periods. Is there any solution for below script?
Find Net Working Days
Actually I am quite new with QV. I already try that trick before I post this discussion. I can't understand / didn't know how to adopt the script into my actual script.
I know this is old, but I have just done this with the networkdays formula and it seemed an easier method
set vHolidays= '01/05/2019','22/05/2019','24/05/5019','19/5/2019';
([End Date]-[Start Date]-(NetWorkDays([Start Date],[End Date])-NetWorkDays([Start Date],[End Date],$(vHolidays)))) as [Start To End Days],//Remove holidays but leave weekends