Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor II
Contributor II

Networkdays return me 2 records

Hi,

I am new to this. just started 1 week ago.

I am try to customized a Dimension for Working days which exclude Weekends and holidays. I loaded an excel source with Holiday

holiday.png

Next in the custom dimension, I added in my expression

= networkdays (NCR_CREATE_DATE, NCR_CLOSE_DATE,Holiday_Date.autoCalendar.Date) - 1

busniess days.png

But I am getting double record. Like to know what happen and how do I do troubleshoot?

Final.png

Between create date to close date, there are 3 holidays. the correct days is 50 days. but why is 49 days appearing?

once I remove the custom working days dimension, it shows me only 1 record.

nodimension.png

1 Solution

Accepted Solutions
Creator II
Creator II

I think your problem is that you're actually only using a single Holiday_Date as an argument in your NetworkDays expression, instead of the entire list of your dates separated by commas


What I found is that you should create a variable in the script that concatenates all your holiday dates, and then use that as a parameter for NetworkDays:


tmpConcat:
LOAD concat(chr(39) & Holiday_Date & chr(39),',')             as HolidayDates
RESIDENT Holidays;

Let vPublicHolidays = fieldvalue('HolidayDates',1);


See: Find Net Working Days

View solution in original post

2 Replies
Creator II
Creator II

I think your problem is that you're actually only using a single Holiday_Date as an argument in your NetworkDays expression, instead of the entire list of your dates separated by commas


What I found is that you should create a variable in the script that concatenates all your holiday dates, and then use that as a parameter for NetworkDays:


tmpConcat:
LOAD concat(chr(39) & Holiday_Date & chr(39),',')             as HolidayDates
RESIDENT Holidays;

Let vPublicHolidays = fieldvalue('HolidayDates',1);


See: Find Net Working Days

View solution in original post

Contributor II
Contributor II

Yes Thanks! I got it