Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
in order to use the below function I would like to load a list of holidays into a variable.
FirstWorkDate(Today(), 1, $(vMyHolidays))
Im stuck.
Any ideas?
Attaching example data and QV-doc.
//O
Olle,
If you are trying to get the start days for all the holidays, you should be using a for loop so that all the holiday values will be included. If this is not clear, please explain more about the final output you are interested in.
Best Regards,
Naresh
Try defining your variable like:
=Chr(39)&Concat(Holidays,chr(39)&','&chr(39))&chr(39)
In the fornt-end
Add this in the script
set vMyHolidays = "max(Holiday)";
where Holiday is the name of the field which contains the list of holidays.
Best Regards,
Naresh
Hi,
Try this expression
=FirstWorkDate(Today(), 1, Chr(39) & Concat(Holidays, Chr(39)&','&Chr(39))&Chr(39))
Regards,
Jagan.
try loading your master calendar like this :
//******* Holiday********
tblHoliday:
LOAD Date(Holiday) as Holiday;
SQL SELECT Holiday
FROM table1;
/************** varHoliday **************/
tmpTbl:
NoConcatenate
LOAD Concat(Holiday,',') as fieldHoliday
Resident tblHoliday;
LET varHoliday = Peek('fieldHoliday',0,'tmpTbl');
DROP Table tmpTbl;
//Script One
Let varMinDate = num(MakeDate(2000,1,1));
Let varMaxDate = num(MakeDate(2020,12,31));
//*************** Temporary Calendar ***************
TempCalendar:
LOAD
$(varMinDate) + rowno() - 1 AS Num,
date($(varMinDate) + rowno() - 1) AS TempDate
AUTOGENERATE
$(varMaxDate) - $(varMinDate) + 1;
//*************** Master Calendar ***************
MasterCalendar:
LOAD TempDate AS CalDate,
Date(TempDate) AS CalanderDate,
If(weekday(TempDate)='Sat' or weekday(TempDate)='Sun' or If(substringcount('$(varHoliday)',Date(TempDate))>0,1,0),0,1) as HolidayFlag
1 As PlannedBD,
..
..
..
..
resident TempCalendar
ORDER BY TempDate ASC;
then use holidayflag to check if it is holiday or not in your calculation.
@Jagan and Naresh,
tried to implement your suggested solutions but holidays are still not calculated for
For instance, for "Date"m 2-jan, prev date should be 30-Dec
Hi balkumarchandel.
Im calling an add in kind of master calendar for all of my apps so your solution is not appropriate for me im afraid.
Thanks though!
For Date 02-Jan-15, there's no holiday associated. So, it doesn't consider 01-Jan-15 as a holiday
Cheers,
Naresh
Sorry, my bad!
Now it should be updated accordingly.
But still no change as far as I can see.
Regards,
Olle