Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Executing script when clicking a button

Hi all,

     Now, I have made a script in my main "Edit Script" tab. The script asks a parameter to the user and then uses it to query a database and shows the results in a straight table. When I click "Reload" those actions are performed.

     I'm adding another table to my qlikview document that will get the information from a different query. This query will take longer to run, so I dont want Qlikview to execute it if it is not necessary. That is why I want to create a button in my document that when clicked will prompt the user for a value, perform a query to a database through ODBC and the n populate a table.

     I havent been able to find how to do it in the button properties, does anyone has done this before?

Thak You!

3 Replies
sinanozdemir
Specialist III
Specialist III

You can include the below expression in your load script:

Capture.PNG

Input() will prompt users to enter a value:

Capture.PNG

Then you can vInput in your load script to reduce the size of your load. You can of course use Reload action for this.

Hope this helps.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

What you want to read up on is "Partial Reload". That allows you to retain some tables and replace others in the reload.

-Rob

tamilarasu
Champion
Champion

Hi,

Sample script. Check the attachment

Set vQueryExecute ='';

Let vQueryExecute=Input('Do You Want to Run the Query? Type Yes or No', 'Query Execute Confirmation');

If (Upper(vQueryExecute)='YES') then

    Data:

    LOAD * INLINE [

    ID, Name

    1, A

    2, B

    3, C

    ];

ENDIF

EXIT Script;