Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am new to qlikview and Need help. I want to Check if for Example today -2 days was a Holiday (all written down in table Holiday) and then just give a Feedback. I cant even Write the if.. Thanks for the help!
i would do this logic in the load script - this way your expressions will be simpler and faster.
i would create a new field in your table where you have your dates (possibly your calendar table) that says whether that date has a holiday 2 days back. so in your table, you can just test for this field = Yes, 1, or whatever value you used.
to do that left join your calendar with the holidays table (can also be the calendar table - actually should be the calendar table) where you less 2 days so it matches up.
here is a sample code (this just shows you how it can be done)
Dates:
load date(today()-iterno()) as Date
while iterno()<100;
load 1 AutoGenerate(1);
NoConcatenate
Holidays:
load Date, if(rnd=1,1) as isHoliday;
load Date, floor(rand()*20) as rnd
Resident Dates;
inner join (Holidays)
load 1 as isHoliday AutoGenerate(1);
left join (Dates)
load Date(Date+2) as Date, Date as ThisIsTheCorrespondingholiday, isHoliday as HasAHoliday2DaysBefore
resident Holidays;
here is a sample look at the resulting fields:
holidays are 2/4 and 2/7
so dates you are interested in are 2/6 and 2/9 which have holidays 2 days prior
hope that helps