Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
The dates are not recognized correctly as date format
Hi,
Cross check your startdate and enddate format..
Try to share your sample qvw that demonstrates the issue.
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
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'))
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.
How to process that variable
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;
no it didnt wort