Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
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 

1 Solution

Accepted Solutions
kashyap
Partner
Partner

Hi

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

Thanks

View solution in original post

8 Replies
kashyap
Partner
Partner

Hi

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

Hope this helps 

thanks

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
Partner
Partner

Hi

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

 

Thanks

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
Partner

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
Partner
Partner

Hi

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

Thanks

View solution in original post

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