Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
Qlik Users,
This is my scenario
If a conference is on a public holiday or on weekend that should be counted as ‘Available on Field’.how can i achieve this in script.i have created weekend flag in master calender by using below script.and now i want to create a flag for getting public holidays on weekdays(mon-fri).
If(WeekDay(Date)='Sat'
,1
, if(WeekDay(Date)='Sun'
,1,
0)
) AS WeekEnd_Flag,
I am attaching my table below.
Thanks
Hi,
you need to manually identify your public holiday dates. Then if you want to see if they are on your weekdays you can do it like this:
IF ( WeekDay(holidaydate)<5, true, false)
Weekday returns dual value (text and numeric), values 5,6 are saturday and sundays (unless you other in FirstWeekDay variable in Main)
Hi,
you could try in this way:
Add a variable:
SET Holidays = 'holiday1', 'holiday2';
Then the flag will be:
If(Match(WeekDay(Date),'Sat','Sun')>0 or Match(Date(Date), $(Holidays))>0,1,0) as WeekEnd_Flag;
If(Match(WeekDay(Date),'Sat','Sun')>0 or Match(Date(Date), $(Holidays))>0,1,0) as WeekEnd_Flag;
is this flag gives weekday holidays and weekend holidays?
Yes, but before you have to set Holidays manually inside the variable
can u guide me how to set variable ?
You have to add this line in the script before the load:
SET Holidays = 'holiday1', 'holiday2', 'holiday3';
instead of holiday1/holiday2/holiday3/ect you have to write holiday dates.