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

Button for include and exclude

Hi All,

My condition is if Type = 'External Contracts'. I want to have to click just one button for including and excluding external contracts. Is it possible to make one button to toggle between the records? Can you please give me an idea on how to create this?

Thanks.

1 Solution

Accepted Solutions
maxgro
MVP
MVP

6 Replies
Not applicable
Author

The first step is to set up a variable by going to settings then variable overview.  Click add and then give your variable a name that's easy to remember, like vShowExternalContracts .

The 2nd step is to create a text box that says the 2 things you want to toggle.  In the white space, right-click then choose text object.  Under the general tab, put something similar in the text box to: 

IF(vShowExternalContracts=0,'Show External Contracts', 'Hide External Contracts')

Step 2A, go to the Actions tab.  Actions should be Set Variable.  To the right, under Variable, type vShowExternalContracts.  Then in the space for value, type If(vShowExternalContracts=1,0,1)

Step 3, assuming you have created the table that you want to show already, right-click on it and go to properties and then layout.  Halfway down the middle on the right, click the button for show "conditional".  Type in vShowExternalContracts .

The 0's and 1's are what makes it toggle back and forth.


sujeetsingh
Master III
Master III

See the sample i have created it through the variables and buttons.

Not applicable
Author

Thanks for your responses but I am not getting the result that I am looking for.

My field is Type and has Maintenance, Database, General, Development. I am looking for a button to do the following: 

When clicked:

Remove Maintenance and show Database, General, Development

When clicked again:

Show all: Maintenance, Database, General, Development

This should apply to all tables and charts in the application.

Can anyone help with this?

Thank you.

lawrenceiow
Creator II
Creator II

Following on from Barbara Boone's suggestion you could add to your expressions

if(Type='Maintenance',value*vShowExternalContracts,value)

replace value with whatever your data has - Sales or Cost or whatever

Or, in your script add

If(Type<>'Maintence','I') as InternalContract

A listbox for Internal Contract will contain I - Selecting I will give you Internal contracts only and with nothing selected will give you all contracts.

For the button approach you could use Select In Field

maxgro
MVP
MVP

PFA

syedmazhar
Contributor III
Contributor III

If the values are more then 1000. And when i tap on button i need to exclude some 400 values. How to achieve this. Please help me with the detail steps.

Thanks in advance.