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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro to activate

Hi!

I have two bar charts  and i have placed them one on each other or we can say overlapped , now what i want is to create a single button or two buttons.And when i click on the button the related chart should come on top and become visible and the other will be hidden under it. i think i need to write  a macro in action properties on the button but i am not getting the code...

thanks

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Instead of macro you can do by setting variable value on onclick and use that as in conditional layout.

     Button1-->actions-->External-->set variable-->vVariable with value 'value'

     Button2-->actions-->External-->set variable-->vVariable with value 'value2'

     Like below

     Chart1:Properties-->Layout-->Condition show-->if(vVariable='value',1,0)

     Chart1:Properties-->Layout-->Condition show-->if(vVariable='value1',1,0)

Hope it helps

Celambarasan

View solution in original post

4 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Instead of macro you can do by setting variable value on onclick and use that as in conditional layout.

     Button1-->actions-->External-->set variable-->vVariable with value 'value'

     Button2-->actions-->External-->set variable-->vVariable with value 'value2'

     Like below

     Chart1:Properties-->Layout-->Condition show-->if(vVariable='value',1,0)

     Chart1:Properties-->Layout-->Condition show-->if(vVariable='value1',1,0)

Hope it helps

Celambarasan

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   All you need to do is  create a variable say vVisibility give value as 1.

   Now create a button which will toggle the value of the variable.

   So put action as External-> Set variable -> Give the name of the variable and put value as

   =if(vVisibility = 1,0,1)

   This will toggle the variable value.

    Now go to the properties of first chart -> layout -> here in show ->  conditonal -> type

   =if(vVisibility = 1,1,0)

    This means when the value of variable is 1, this will how the chart

    Same way go to the properties of other chart and put

    =if(vVisibility = 1,0,1)

    This way you can show and hide the objects on button click

Regards,

Kaushik Solanki   

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
jagannalla
Partner - Specialist III
Partner - Specialist III

Hello,

Create a variable vShow and assign a value as 1.

In first chart ->Properties -> Layout -> Show ->Condition -> vShow =1

In Second Chart >Properties -> Layout -> Show ->Condition -> vShow =2

Take two buttons

first button: Actions -> External - Set Varibale -> Variable  - vShow and value 2

Properties -> Layout -> Show ->Condition -> vShow =2

Second button: Actions -> External - Set Varibale -> Variable  - vShow and value 1

Properties -> Layout -> Show ->Condition -> vShow =1

Not applicable
Author

Hi! Celambarasan,

it worked..thanks