Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
surajap123
Creator III
Creator III

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 III
Creator III
Author

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

thanks again.