Returns the number of working days (Monday-Friday) between and including start_date and end_date taking into account any optionally listed holidays. All parameters should be valid dates or timestamps.
networkdays (startdate, enddate, holidaydate1, holidaydate2,holidaydate3,holidaydate4.......)
networkdays ('2006-12-18', '2006-12-31', '2006-12-25', '2006-12-26')
hope this help
Having different holidays by country would be more complicated than what I did in that thread, though. Attached is one way to do it. Again, we're generating a holiday list in a variable, but now we generate a pick(match()) to select the right holiday list by country. I don't like that I have a separate load for each country, but I can't think of how to get around it. It probably won't be a problem in practice since the tables involved at that point are small.
I completely made up these holidays, so don't look for them to make any sense.
Here's the script:
LOAD * INLINE [
LOAD text(fieldvalue('Country',recno())) as Country
,recno() as Sequence
LOAD concat(chr(39) & Country & chr(39),',',Sequence) as AllCountries
LET allholidays = '=pick(match(Country,' & peek('AllCountries') & ')'
FOR I = 1 TO noofrows('Countries')
LOAD concat(num(Holiday),',') as AllHolidays RESIDENT Holidays WHERE Country = peek('Country',$(I)-1,'Countries');
LET allholidays = allholidays & ',' & chr(39) & peek('AllHolidays') & chr(39);
DROP TABLE AllHolidays;
LET allholidays = allholidays & ')';
LOAD * INLINE [
Then I made a list box with always one Country selected, and I used expressions like these.
firstworkdate(Date,4,$(allholidays)) // in a straight table by Date