Re: Match countries to get holidays for NetWorkDays formula
The syntax of NetWorkDays allows the list of Holidays to be added at the end. In order to make it work, the list of holidays needs to be saved in a variable (not in a field). Here is what I would do in this case:
1. Load the Holidays per Country with a GROUP BY clause, using the Concat() function to generate the list of all Holidays for each Country. You will need to play with the exact formatting to get it right for the NetWorkDays()
2. Read the resulting summary table line by line, fetching the list of Holidays and the Country into two variables, using Peek().
3. For each Country, read the first table with the WHERE clause (filtering on the Country field). Use the variable with Holidays in the NetWorkDays function. Something along these lines:
NetWorkDays(StartDate, EndDate, $(vHolidays) as WorkDays
Country = '$(vCountry)'
Repeat this logic in the loop for all countries that exist in the summarized second table.
Check out my new book QlikView Your Business - available to pre-order on Amazon!