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: 
jim_chan
Specialist
Specialist

how to use button to swap different expression on a chart?

Hi guys,

i have a problem here. Ok, i have created a scatter chart here.

Client request to use button to trigger different expression on the same chart...

for example: button1 for group A (p1-p5) button2 for group B(p10-p15)

2 same expression: expression1 = sum(value), expression 2 sum(percentage).

so when cllient click on group A button - it shows group p1-p5 only and the same expression.

trigger.jpg

How can i achieve something like this?  help help help!

Rgds,

Jim

3 Replies
MK_QSL
MVP
MVP

Create a Variable...vShow

Go to Expression Tab

Use 1st Expression

sum({<age = {'P1','P2','P3','P4','P5'}>}value)

Use Conditional Show

vShow = 1


Use 2nd Epxression

sum({<age = {'P10','P11','P12','P13','P14','P15'}>}value)

Use Conditional Show

vShow = 2


Now Create a Button

Go to Action Tab

Add -- External -- Set Variable

Variable

vShow


Value

=If(vShow = 1, 2, 1)

jim_chan
Specialist
Specialist
Author

Thanks Manish! do i need to change the expression of the chart object? suppose, mine is a scatter chart.

MK_QSL
MVP
MVP

You need to show P1 to P5 for first click

and

P11 to P15 on 2nd click...

So obviously you need to change Expression accordingly...

There are other way also without changing the expression but it will require to change

first click Show All

2nd click P1 to P5

3rd click P10 to P11

Depends on how you want to show..