Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
blurrblurr
Contributor III
Contributor III

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

blurrblurr
Contributor III
Contributor III
Author

Yes Thanks! I got it