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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hide/Show Objects based on selection

Hi All,Show_hide.PNG

In my application I am having two objects(LB06,LB07), My requirement is when I click one button will display one object(LB06) and click on second button will  display second object(LB06). Can we achieve this one.

12 Replies
sorrakis01
Specialist
Specialist

Hi,

1. Create a variable. For exemple vShow = 1

2. Then in properties object button, on Actions Tab, Add, External Set Variable,

  Variable : vShow

   Expresion: If($(vShow)=1,0,1)

3. In properties of object charts use conditional show. Expresion: $(vShow) = 1 (for 1 object) and $(vShow) = 1 (for the other onject).

Regards

marksmunich
Creator III
Creator III

set variables to the objects which you want to display.

create two variables vDisplay and vHide and set both to one

now set this variables in the layout tab of the object and choose conditional 

for example vDisplay=1 as the condition.

now in button, go to the actions tab and click add and choose external option and click set variable and provide the value to variable like vDisplay=0 and create one more similar and set vHide=0. Have this set of variables in both the variables and play around.

Not applicable
Author

Thanks,

when I click on one button want to display only one object(LB06) and other object want to be hide.And

one button want to display only one object(LB07) and other object want to be hide.Can we do this one.

sorrakis01
Specialist
Specialist

Hi,

If you use 2 variables, you can use 2 trigger actions.

Set variable:

Variable : vShow

   Expresion: If($(vShow)=1,0,1)

   or only value

Set variable: vShow2

   Expresion: If($(vShow2)=1,0,1)

   or only value


You can play with various possibilities.


Regards

mightyqlikers
Creator III
Creator III

Hi

write the condition in button layout when u want to display that .

Regards

Sam

awhitfield
Partner - Champion
Partner - Champion

Yes you can, simple example attached

HTH

Andy

jonathandienst
Partner - Champion III
Partner - Champion III

Jordi's solution is correct, except that the conditional show for the second LB  should be =vShow = 0.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
marksmunich
Creator III
Creator III

Yes, you can do it. In the button you can set variables to the object which you want to display to 1 and other object to 0. and the same with other button you can set one variable to 0 and other to 1.  first of all you need to create 2 variables in the sheet and use this variables in the layout conditional tab. then you will understand how it works. but is like a trigger. when u click on it, it changes the values of variables, which displays or hides the objects based on condition.

Not applicable
Author

Hi Jonathan,

Explain one example here practically with script..........