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

NetWorkDay expression not picking correct information

Hello,

I am new to QlikView.I want to calculate Total  networkdays for my Dashboard.I want to show the number of days.

I have following data:

Start date

End date

For holidays i createed a variable vHoliday and run script

set vHoliday =
'2011/01/01',
'2011/03/21',
'2011/04/22',
'2015/04/06',
'2015/04/27',
'2015/05/01',
'2015/06/16',
'2015/08/09',
'2015/08/10',
'2015/09/24',
'2015/12/16',
'2015/12/25',
'2015/12/26';

Total=

NetWorkDays(Start date,End date,$(vHoliday))


but its Returning 0 as Total value.

What is the problem with this expression here.pls suggest.

Thank you.

11 Replies
alexandros17
Partner - Champion III
Partner - Champion III

The dates are not recognized correctly as date format

sushil353
Master II
Master II

Hi,

Cross check your startdate and enddate format..

tresesco
MVP
MVP

Try to share your sample qvw that demonstrates the issue.

sasiparupudi1
Master III
Master III

try putting your holiday in online

set vHoliday ="'2011/01/01','2011/03/21','2011/04/22','2015/04/06','2015/04/27','2015/05/01','2015/06/16','2015/08/09','2015/08/10','2015/09/24','2015/12/16','2015/12/25','2015/12/26'";

HTH

Sasi

Not applicable
Author

Thank u.It was in different format.I converted it to Start Date and End Date format to $vHoliday format.Then it Worked.

But i have one more Question why cant i change $vHoliday format to  Start Date and End Date format.

below :

==NetWorkDays([Start Date],[Exp End Date],(Date(Date#($(vHoliday)),'YYYY/MM/DD'),'DD/MM/YYYY'))

jonathandienst
Partner - Champion III
Partner - Champion III

vHoliday is not a date, it is a list of dates. The Date# and Date functions accept a single string or single number respectively and cannot process your variable.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

How to process that variable

jonathandienst
Partner - Champion III
Partner - Champion III

Like this:

Let vHoliday2 = '';

For Each vDate In $(vHoliday)

  Let vDate2 = Date(Date#(vDate, 'YYYY/MM/DD'), 'DD/MM/YYYY');

  Let vHoliday2 = vHoliday2 & If(Len(vHoliday2) > 0, ',', '') & '''' & vDate2 & '''';

Next

Let vHoliday = vHoliday2;

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

no it didnt wort