Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Reload part of the script using buttons

Hi All,

I am having 10 tables in script ,each schema having 5 tables ,so I have 2 data models in a script .

My requirement is I want to split 2 different schemas and also want to 2 buttons in UI. when I click on button 1 then schema 1 should get reload and when I click on button 2 schema 2 should reload instead of all tables.

Please suggest

13 Replies
sunny_talwar

May be this:

IF $(vVar1) = 1 then

  Table1:

  LOAD * Inline [

  Dim1, Value1

  A, 600

  ];

ELSEIF $(vVar1) = 0 then

  Table2:

  LOAD * Inline [

  Dim1, Value2

  B, 800

  ];

ENDIF

But once you reload one table, the other will go away. Are you wanting to just update one and leave the other one intact? If that's what is needed, may be you can do it will partial reload

sunny_talwar

Partial Reload version:

IF $(vVar1) = 1 then

  Table1:

  Replace

  LOAD * Inline [

  Dim1, Value1

  A, 100

  ];

ELSEIF $(vVar1) = 0 then

  Table2:

  Replace

  LOAD * Inline [

  Dim1, Value2

  B, 200

  ];

ENDIF

Not applicable
Author

Create two separate application for each schema.

Now add button in each application.
Open the button properties---> add the action 'Reload'.
So when you click the button the application gets reloaded.

Not applicable
Author

Sourav already I am doing the same way ,having 2 separate QVW files but I want both in the single one.

Not applicable
Author

Hi Sunny,

Then how can I call those in buttons ?

If I select button1 then script1 should reload and if I click on button2 script 2 should get reload.

Not applicable
Author

I am using above code in my script .

Took 2 buttons which are B1 and B2.

B1 Properties:

SetVariable

Value =vVar1

Variable=vVar1

Relaod

B2 Properties:

SetVariable

Value =vVar1

Variable=vVar1

Relaod

When I am clicking on B1 or B2 only executing Table 1 .

If I click on B1 then Table1 should execute and if I click on B2 table2 should execute.

Not applicable
Author

Not getting the Table2 in datamodel.

sunny_talwar

Which of the two solution have you been using? and what is the expectation? One of the two tables stays and the other one goes away or you need that one stays and other gets updated?

Not applicable
Author

I am using first solution.

Both models should be there in project only based on the button event they should be reload.

One should be there and other need to get reloaded based on the button click.