Skip to main content
Announcements
Announcing Qlik Talend® Cloud and Qlik Answers™ to accelerate AI adoption! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Reload If Weekday between 8am - 5pm

Hi All

I have this script in my model(s) to test whether its between 8a and 5pm or Sat or Sun and not last day of month else Exit Script:

IF Hour(Now()) > 17 and Hour(Now()) < 7 or DayName(Today()) = 'Sat' or 'Sun' and Day(Today()) <> Day(MonthEnd(Today())) THEN

Exit Script;

END IF;

Problem is, the task schedule reloads this model, runs this script and exits.  This means my data in the model is all gone as nothing loaded as the script exited?

I am looking for the model to only reload as stipulated otherwise nothing. This works well for my models which are simply models to reload my QVD files, but the visual models end up being empty on the Access Point?

Any help please?

1 Solution

Accepted Solutions
santiago_respane
Specialist
Specialist

Maybe if you separate your app in layers, this could help:

1 - Extract layer: Reload condition goes here. Update QVDS only if condition is false, otherwise use the "exit script" sentence and QVDS will remain the same.

2 - UI layer: load from existing QVDS. In this layer its irrelevant if QVDS where updated or not

Let me know if this helps,

Kindest regards,

View solution in original post

4 Replies
santiago_respane
Specialist
Specialist

Maybe if you separate your app in layers, this could help:

1 - Extract layer: Reload condition goes here. Update QVDS only if condition is false, otherwise use the "exit script" sentence and QVDS will remain the same.

2 - UI layer: load from existing QVDS. In this layer its irrelevant if QVDS where updated or not

Let me know if this helps,

Kindest regards,

lironbaram
Partner - Master III
Partner - Master III

hi

what i did in this case

i added  a qv  model that only checks the rule and failed if the rule don't apply

then in the reload schedule i set the target model to load only if the new model succeeded

the only downfall for this is that you'll have in your qmc a model that failed in the weekends and nights

Not applicable
Author

‌thanks Santiago

i have my qvd's being updated by one qvw model. Dependent on its successfull running i then reload my visual models one after another. So would i just have a qvw with the above script to test the dsy of week, hour of day and last day of month and if it is fail it on purpose so the the dependent reloads do not happen?

thing is, i also dont want these visual reloads running unless falls i to the scripted time frames?

HirisH_V7
Master
Master

Dear  Santiago ,

Please post a sample app . as of my request .

Thanks,

hirish

HirisH
“Aspire to Inspire before we Expire!”