Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
jim_chan
Specialist
Specialist

How to use buttons to change a text in a text object

Hi there, 

I have an issue here, hope you guys can help. 

Request:

Example, i have 1 text object to display 2 different message. When i click on button 1 - it will show 'Hello World' , when i click on button 2, it will show 'Hello Heaven'. 

Problem:

Sorry of my screenshot. i use color instead. but ultimately i want to to display different text, when i click on different buttons.

jim_chan_0-1654684645895.png

I have created variable called - vbutton1. and definition = 1.

Button1 = i put 1, Button2 , i put 2

jim_chan_1-1654684931109.png

jim_chan_3-1654685009078.png

in the text object expression , i put if($(vbutton1) = 1,blue(),red())

so when click on button 2, it didnt change to RED. no response at all. 

Please help guys!

Rgds

Jim

 

 

 

 

 

1 Solution

Accepted Solutions
abhijitnalekar
Specialist II
Specialist II

hI @jim_chan 

Please follow the below steps

1. Create variable in my case i have created as vTest

abhijitnalekar_0-1654688389958.png

2. Drag a button to the sheet

3. Go to action and navigation and select 'set variable value' from the drop-down

4. give the button a value 1 for button 1 and do the same for the second button and except set value 2 for second button.

abhijitnalekar_1-1654688521126.png

drag  a text box and put the below expression

if(vTest=1,'Red','blue')

 

 

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

7 Replies
abhijitnalekar
Specialist II
Specialist II

Hi @jim_chan ,

In button property you should replace variable from vAvgSaleBLB to vbutton1.

 

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
jim_chan
Specialist
Specialist
Author

No no... that just an example.  Doesn't matter it is vbutton1 or vAvgSaleBLB. My point is,  the whole thing didn't work. 

Or can you show me, how to create buttons to change text in 1 text object ?

 

Rgds

 

Jim

abhijitnalekar
Specialist II
Specialist II

ooh.. in that case please remove the = sign from the variable you have set

eg - just put 1 instead =1

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
jim_chan
Specialist
Specialist
Author

Hi there,

I don't really get you. Put 1 instead of =1 ?

if($(vbutton1) = 1,blue(),red())  how ?

 

abhijitnalekar
Specialist II
Specialist II

hI @jim_chan 

Please follow the below steps

1. Create variable in my case i have created as vTest

abhijitnalekar_0-1654688389958.png

2. Drag a button to the sheet

3. Go to action and navigation and select 'set variable value' from the drop-down

4. give the button a value 1 for button 1 and do the same for the second button and except set value 2 for second button.

abhijitnalekar_1-1654688521126.png

drag  a text box and put the below expression

if(vTest=1,'Red','blue')

 

 

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
shravanveer
Contributor II
Contributor II

haloc  @jim_chan 

Button1 = i put 1, Button2 , i put 2

make changes in button='1',button='2'

add siglecout

jim_chan
Specialist
Specialist
Author

Hi there, 

 

Sorry for my late reply.   i will try it out today bro. and update you.

RGds

 

Jim