You should also be able to generate the string in the script with something like the following (not tested). Regards.
(ooxml, embedded labels, table is Sheet1);
Let vNroRegistros = NoOfRows(Holidays);
For vI = 0 to (vNroRegistros - 1)
if vI=0 then
Let vHolidays = chr(39) & Peek('Holiday',vI,'Holidays');
elseif vI<(vNroRegistros - 1) then
Let vHolidays = $(vHolidays) & ', ' & Peek('Holiday',vI,'Holidays');
Let vHolidays = $(vHolidays) & ', ' & Peek('Holiday',vI,'Holidays') & chr(39);
Someone pointed out recently that it was easier to make a list with concat() instead of with a loop. So I recently revised my old example to load a holiday list that way. See attached.
This does NOT include the creation of the text file with the list of holidays. Not sure how you go about that part. I would think you'd just load from an SAP holiday table, but I know next to nothing about SAP, so I'm no help there, and it sounds like that might be where you're having trouble, in which case my example is useless to you.
Still, in case it's useful...
testHolidayTableInFunctions2.qvw 123.8 K
thank you both so much for your help. I finally settled on Johns method, using the following code in my script to create the Workday-no of each date + the total amount of workdays in that month:
load concat(Holiday, ',') as Holidays
where Region = 'D_NW'
let vNetWorkDays = 'networkdays($1, $2, ' & peek('Holidays') & ')';
drop table Holidays;
$(vNetWorkDays(monthstart([Invoice date]), [Invoice date])) as Workday,
$(vNetWorkDays(monthstart([Invoice date]), monthend([Invoice date]))) as [Workdays total],
Amazingly enough, I just extracted the whole list of holidays from SAP (from 01.01.2005 upwards) and networkdays did not have a problem processing the endless list.
Have a good night (I was really surprised at your late postings, until I saw the timezone you are in),