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

button to toggle

Hi All,

I have below dataset. I want to filter data on Status field using a button.

Data:
LOAD * INLINE [
    No, Status, Dim, Amount
    1, Open, dim1, 456
    2, Completed, dim2, 43
    3, Open, dim3, 23
    4, Assigned, dim4, 762
];

I wanted to cleate a single button that act as toggle.
One first click it should show all values in status field(logically clearing selections on status field) and on next click on the same button it should EXCLUDE 'completed' status.

Please help!

1 Solution

Accepted Solutions
Sergey_Shuklin
Specialist
Specialist

Hi, Suraj!

Create a button and the variable, name variable for instance vButtonClick. In Action Tab of Button properties choose an action "set variable" in External block and make this condition for variable vButtonClick: =if(vButtonClick=1,0,1). Then make a second action which will do a selection in field (Selection - Select in Field):

=if(vButtonClick=1,'=wildmatch(Status,'&chr(39)&'*Completed*'&chr(39)&')=0',)

First click should clear all, and the second should select all except values with 'Completed' string.

Hope it helps!

View solution in original post

4 Replies
tresesco
MVP
MVP

PFA

prma7799
Master III
Master III

Please check ....

Sergey_Shuklin
Specialist
Specialist

Hi, Suraj!

Create a button and the variable, name variable for instance vButtonClick. In Action Tab of Button properties choose an action "set variable" in External block and make this condition for variable vButtonClick: =if(vButtonClick=1,0,1). Then make a second action which will do a selection in field (Selection - Select in Field):

=if(vButtonClick=1,'=wildmatch(Status,'&chr(39)&'*Completed*'&chr(39)&')=0',)

First click should clear all, and the second should select all except values with 'Completed' string.

Hope it helps!

surajap123
Creator II
Creator II
Author

Thanks everyone for the help. Sergey's expression helped me to pass multiple values.

thanks again.