Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2023, a live, in-person thrill ride. April 17 - 20, 2023, in Las Vegas! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Zimm
Contributor II
Contributor II

How to create a button that will filter and show only specific columns of table.

Below is a sample table. I would like to create a button that will filter to lets say only show columns B and E. I don't want any other columns to be shown when clicking this button besides B and E. Also, no rows should be filtered out either.

 

  A B C D E F G
S 2 2 0 0 1 3 1
T 2 3 1 3 0 3 3
U 2 2 5 1 0 3 5
V 5 5 2 3 0 3 1
W 2 2 0 5 0 2 2
X 3 3 0 1 0 5 1
Y 2 2 3 3 0 3 3
Z 1 1 0 3 5 2 0

 

Result looks like this after pressing button.

  B E
S 2 1
T 3 0
U 2 0
V 5 0
W 2 0
X 3 0
Y 2 0
Z 1 5

 

Thank you for the help.

Labels (1)
1 Solution

Accepted Solutions
ogster1974
Partner - Master II
Partner - Master II

1. Create a variable to store the condition to show your columns. I have vShowColumns default value 1 and reduced columns 2.

2. Create 2 buttons one to set the variable condition to state 2 and another to return it to state one.

3. Create your table and add the following to your columns that will display under the "Show column If" condition.  Show showing under state 2 use =If($(vShowColumns)>=1,1,0) for showing under state one =If($(vShowColumns)=1,1,0)

End result

State vShowColumns=1 show all Sales breakdown

ogster1974_0-1674671504499.png

State vShowColumns=2 Show Total Sales only

ogster1974_1-1674671539127.png

 

 

View solution in original post

2 Replies
ogster1974
Partner - Master II
Partner - Master II

1. Create a variable to store the condition to show your columns. I have vShowColumns default value 1 and reduced columns 2.

2. Create 2 buttons one to set the variable condition to state 2 and another to return it to state one.

3. Create your table and add the following to your columns that will display under the "Show column If" condition.  Show showing under state 2 use =If($(vShowColumns)>=1,1,0) for showing under state one =If($(vShowColumns)=1,1,0)

End result

State vShowColumns=1 show all Sales breakdown

ogster1974_0-1674671504499.png

State vShowColumns=2 Show Total Sales only

ogster1974_1-1674671539127.png

 

 

Zimm
Contributor II
Contributor II
Author

Thank you Ogster. Took me a bit to figure out all the steps but eventually got it. Worked perfectly.