Discussion Board for collaboration related to QlikView Deployment.
I wish to create a snapshot of my small data table every monday except on those days that fall on a holiday.
On a normal Monday I load data, but if it is a holiday I need to load on the Tuesday and if that is a holiday ..... etc. The data is stored in a SQL database as are the tables that define holidays.
Any ideas ?
Thanks in advance
Go to Solution.
Something like this:
Let HolidayToday = date('12/31/2009'); // should be a current date in the real scriptlet WorkToday = date('2/1/2009'); // should be a current date in the real scriptHolidays:load * inline [Holiday12/31/20091/1/2010];left join (Holidays)load Holiday ,date(Holiday) as HolidayDateresident Holidays;Condition:load 'HolidayToday' as Today, if(exists(HolidayDate, '$(HolidayToday)'), 0, 1) as LoadFlagautogenerate 1;load 'WorkToday' as Today, if(exists(HolidayDate, '$(WorkToday)'), 0, 1) as LoadFlagautogenerate 1;// peek first recordlet TheFlag = peek('LoadFlag', 0, Condition);if TheFlag = 1 then Data: load * inline [ id,name 1,aaaaaaa 2,bbbbbb 3,ccccc ];end if
In the start of the script put
Load Date,from Holidays;
if exists(today(),Date) or weekday(today()) <> 'mon' or vFlagSkippedMonday <> 1 then
if exists(today(),Date) and weekday(today()) = 'mon' then
LET vFlagSkippedMonday = 1;
Thank you - And very fast too !!!!