Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

NetWorkDays with exclusion of holidays in script possible?

Hi All,

is it possible to exclude list of holidays from NetWordDays function in Script?

Note: list contains company holidays of 2 years. so cant process this in Chart expression..

Please suggest.

Thanks & Reagrds

Jyothi

1 Solution

Accepted Solutions
Not applicable
Author

Below code worked fine!

tblHoliday:

LOAD Day as Holiday

FROM

(.....Filename.)

/************** varHoliday **************/

tmpTbl:

NoConcatenate

LOAD Chr(39) & Concat(Holiday,Chr(39)&','&Chr(39))&Chr(39) as fieldHoliday

Resident tblHoliday;

LET varHoliday = Peek('fieldHoliday',0,'tmpTbl');

and then using below function inside table load:

NetWorkDays([Start Date],[End Date],$(varHoliday)) as WorkingDays

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Yes, you can use newtworkdays() in the script.

Yes, you can use any number of holidays in chart expression as well.

And, see this: Calculating Holidays in script

Not applicable
Author

Hi Mike,

Thanks for sharing the informative post.

I already have an external file with list of holidays which is updated every year.

could you please suggest how do i modify the script to accommodate this?

Thanks & Reagrds

Jyothi

Anonymous
Not applicable
Author

No, I can't, because I don't know your application... or at least your script.

Not applicable
Author

Below code worked fine!

tblHoliday:

LOAD Day as Holiday

FROM

(.....Filename.)

/************** varHoliday **************/

tmpTbl:

NoConcatenate

LOAD Chr(39) & Concat(Holiday,Chr(39)&','&Chr(39))&Chr(39) as fieldHoliday

Resident tblHoliday;

LET varHoliday = Peek('fieldHoliday',0,'tmpTbl');

and then using below function inside table load:

NetWorkDays([Start Date],[End Date],$(varHoliday)) as WorkingDays