Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
racer25
Creator
Creator

Refresh Hourly but not during the night..

Hi,

I am looking to refresh hourly a single Qlikview document between the hours of 8am and 5pm.

There is absolutely no point in it running the process evenings/nights/weekends etc.

I can see from the QMC my options seem to be hourly or daily? Furthermore I can't see more than one refresh per app.

Is there a way of doing this to a custom schedule?

Thanks in advance

Rob

Labels (2)
1 Solution

Accepted Solutions
julian_rodriguez
Partner - Specialist
Partner - Specialist

Another idea:

May be you can add some code on the top of the script, asking and comparing the current time and the currend day of the week.

Something like:

LET vCurrentDay = WeekDay(Today());
LET vCurrentHour = Hour(Time(Now()));

If $(vCurrentDay) = 'Sat' or $(vCurrentDay) = 'Sun' THEN // It's  weekend!
EXIT Script;
ELSEIF $(vCurrentHour) >= 8 And $(vCurrentHour) <= 17 THEN // It's  time to work!
  // Insert your code from here:

  LOAD * INLINE [
    TEST
    A
    B
    C
];

// to here
ELSE
EXIT Script;
END IF;


And you may Schedule this task hourly, everyday, but the long code only will be executed when both conditions be true, otherwise it will run a few lines asking for the day and time, no more.

Regards

View solution in original post

8 Replies
julian_rodriguez
Partner - Specialist
Partner - Specialist

Hello Rob,

The only approach could be "clone" the qvw's as many programmations you need, but it will be around 40 tasks easy (too much administration, but it's the only way).

The best option to do that is purchasing Qlikview Publisher, with this add in you can do that and much more!

Regards,

Julian

racer25
Creator
Creator
Author

Hi Julian,

I was thinking of a command line refresh and then as an ugly method create several windows tasks to complete this and maybe let the QMC run the 1st one for logging purposes?

  1. "C:\Program Files\QlikView11\qv.exe" /r "C:\File.qvw" 

I was trying to be slightly more elegant?


Thanks,


Rob

julian_rodriguez
Partner - Specialist
Partner - Specialist

Another idea:

May be you can add some code on the top of the script, asking and comparing the current time and the currend day of the week.

Something like:

LET vCurrentDay = WeekDay(Today());
LET vCurrentHour = Hour(Time(Now()));

If $(vCurrentDay) = 'Sat' or $(vCurrentDay) = 'Sun' THEN // It's  weekend!
EXIT Script;
ELSEIF $(vCurrentHour) >= 8 And $(vCurrentHour) <= 17 THEN // It's  time to work!
  // Insert your code from here:

  LOAD * INLINE [
    TEST
    A
    B
    C
];

// to here
ELSE
EXIT Script;
END IF;


And you may Schedule this task hourly, everyday, but the long code only will be executed when both conditions be true, otherwise it will run a few lines asking for the day and time, no more.

Regards

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

You have the option to set the schedule time in QMC. See screen print attached. Click on the green + sign to have this dialog box

Run Hourly 8_5pm.png

julian_rodriguez
Partner - Specialist
Partner - Specialist

Gabriel, that's correct if you have Publisher. I guess it's not the Rob's case.

Bill_Britt
Former Employee
Former Employee

Hi Robert,

If you decide to run a command line, I would look at doing a batch reload. Attached you will find the information on how to do it. This is from a older version 10 manual (not sure why they don't include it any more). It is a cleaner way to do it and it doesn't take up a license.

Bill

Bill - Principal Technical Support Engineer at Qlik
To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.
racer25
Creator
Creator
Author

Thanks everyone some good suggestions to work though particularly like JULIAN.RODRIGUEZ "In Script" approach.

anandkamat
Contributor II
Contributor II

Hi,

Use the below script in the beginning.

if hour(now())<=11 or hour(now())>=22 then
exit script;
endif