Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Rkota
Contributor III
Contributor III

refresh QV document twice a week

hello - I only need my document to be refreshed twice a week.  Since there is no option to do that as a setting, I am trying to use the EXIT Script function with weekday(now()) = 'Tue' or... to skip the document from being refreshed.  However, when I tried to test that, the data on the document was gone... Am doing something wrong. Any help would be greatly appreciated...

 

Thank You

3 Replies
pradosh_thakur
Master II
Master II

I can think of two ways

1: On the day when qvw should not reload in the else statement make some deliberate error so the document will fail to reload so data wont be refreshed

this has one drawback that to general user it may seem the load has failed

2: add one line  of load on the day when it should not reload

add load * inline [

dim

1

2

];

notice i have written add load , so you have to enable partial relaod in qmc task.

The logic behind is this is on the day when it should relaod it will refresh the data where as on the day when it should not it will partial reload so it will add the inline data with the existing data , so document will not be in failed state.

 

Hope this makes sense

regards

Pradosh

Learning never stops.
Rkota
Contributor III
Contributor III
Author

Thanks for your comment Pradosh.  Pardon the question because I haven't used the "load" statement.  Normally, I embed my SQL script and use QV for display, color, charts and some manipulation using scripting in expressions.

Essentially, I need to plot by a attribute "run date" which will be the two days of the week I'm looking to gather data through my SQL script.  So, is there a way to just run the "Select ...from tbl" statement alone through this add load * ,,,

Hope this makes it somewhat more clear as to what I'm attempting to do.

Again, thanks for your help.

Best Regards,

pradosh_thakur
Master II
Master II

Hi

I understand that you are doing something else in the UI. My comment was related to how you can reload the data without loosing the data

I guess you are using something like this. The below is to just demonstrate what i want to show and might contain syntax error

if weekday(today()) =Tuesday then

 

your script

else

exit script ;

end if

 

..........

 

what i am proposing is

either

if weekday(today()) =Tuesday then

 

your script

else

load *

resident ghafatr;   // this line will fail and document will not be relaoded anyday other than tuesday and data is safe

end if

 

 

or the one below

if weekday(today()) =Tuesday then

 

your script

else

add load *   

inline [

dim

1

2

];     // this will add the extra dim with the existing data so that you dont loose your data

end if

 

I hope i am clear now and din't confuse you more.

Let me know if you need any more clarification.

 

Thanks

Pradosh

Learning never stops.