Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
btrinh
Contributor II
Contributor II

Execute script based on QMC reload task?

Hello,

I would like to ask if it's possible to control which line of script is executed based on QMC reload task name?
For example, if reload is triggered via reload task 1 (with partial reload enabled), only script lines number 50 to 100 are executed, and the rest will be skipped. 

Labels (1)
1 Solution

Accepted Solutions
rubenmarin

Hello, you can set a button that changes a variable and does the reload, the script can check that variable.

As an app owner it works, i'm not sure if you'll need to set additional permissions so users can change the variable and the script uses the changed value, not the original.

View solution in original post

5 Replies
rubenmarin

Hi, if the difference is that one tasks is partial reload and the other no, you can use the IsPartialReload() function

https://help.qlik.com/en-US/sense/August2022/Subsystems/Hub/Content/Sense_Hub/Scripting/SystemFuncti...

deepanshuSh
Creator III
Creator III

If i am interpretating it correctly, there is task after which you need to run another app based on partial or full reload. So Another way to do it, would be to create another QVW and call the last updated time of the previous app and then execute the said app, otherwise exiting from the script. An reference to what might the script could look is over here in an older post. 

https://community.qlik.com/t5/QlikView-App-Dev/Reload-a-task-on-QVMC-when-our-data-has-updated/m-p/1...

Trial and error is the key to get unexpected results.
btrinh
Contributor II
Contributor II
Author

@rubenmarin @deepanshuSh 


Hello, thank you for your replies. Here is the context of my question (sorry I should have provided it in the question):

I have a Qlik Sense app connected to multiple database tables that are constantly updated. The app is auto-reload via a full reload task everyday, and there is also a button for users to trigger a full reload if they want to see real-time data.

However, full reload takes longer than what users want, so I'm looking into improving the load time.

I'm thinking about giving users multiple buttons, each button triggers a partial reload of a certain group of tables. For example, if users want to see real-time data on topic A, they'll click button 1, and only the tables related to topic A will be reloaded while other tables stay the same. I couldn't find any example of such things online, so I wonder if this approach is even possible? 

rubenmarin

Hello, you can set a button that changes a variable and does the reload, the script can check that variable.

As an app owner it works, i'm not sure if you'll need to set additional permissions so users can change the variable and the script uses the changed value, not the original.

btrinh
Contributor II
Contributor II
Author

That sounds like a good solution. I will try it out. Thank you!