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: 
fabios
Contributor III
Contributor III

Excluding holidays from dataset using NetWorkDays

Hi,

 

I'm trying to automate holiday exclusion in NetWorkDays but keep getting an error.

 

My app helps control a process. Employees from different countries must complete a task within 48 working hours - excluding weekends and public holidays. Each employee has different public holidays since they're from different countries. 

 

I've been using NetWorkDays(StartDate, EndDate) with the right result. I've also tried adding holidays manually and it works: NetWorkDays(StartDate, EndDate, '01.01.2020', '02.01.2020').

 

If I try to use a concat for the holidays, it breaks. I've tried all the options below. Needless to say, when I print simply the results of the Concat, everything is fine.

  • NetWorkDays(StartDate, EndDate, Concat(HolidayDate, ', '))
  • NetWorkDays(StartDate, EndDate, Concat([HolidayDate.autoCalendar.Date], ', '))
  • NetWorkDays(StartDate, EndDate, Concat('''' & Text([HolidayDate.autoCalendar.Date]) & '''', ', '))

 

What am I doing wrong? It seems like Concat is not the right option, but why?

 

Cheers,

Fabio 

Labels (5)
1 Solution

Accepted Solutions
Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

It works  for me what @martinpohl suggested please go thru the app attached

Thanks

Thanks and Regards
Kashyap.R

View solution in original post

8 Replies
Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

try creating a variable and assign the holidays to that variable and use that in the expression.

Hope this helps 

thanks

Thanks and Regards
Kashyap.R
fabios
Contributor III
Contributor III
Author

Hi,

 

Do you mean like vListHolidays = Concat(HolidayDate, ', ')?

 

I have already tried but it didn't work.

 

Best,

Fabio 

Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

Can u please tell me what is in the Holiday date and format?

 

Thanks

Thanks and Regards
Kashyap.R
fabios
Contributor III
Contributor III
Author

It's date objects in standard format - e.g. 01.01.2020.

 

I have created a test app for clarity.

 

Best,

Fabio 

martinpohl
Partner - Master
Partner - Master

try instead:

vListHolidays = chr(39)&Concat(HolidayDate, chr(39)&','&chr(39))&chr(39)

to set all holidayday dates in ' '

Regards

fabios
Contributor III
Contributor III
Author

Hi,

 

It doesn't change anything 😕

Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

It works  for me what @martinpohl suggested please go thru the app attached

Thanks

Thanks and Regards
Kashyap.R
fabios
Contributor III
Contributor III
Author

Thanks, issue found! Your app adds an equal sign to the variable expression (which is why it cannot be printed in the table). With that, everything works.

missing equal.jpg