Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Aspiring_Developer
Creator III
Creator III

Show data in a single chart on click of a button qliksense

Hi All,

I wish to achieve below :-

Button Closed  Logged

 

Chart A  
Dim Issue Closed Date
Measure Count(Issue no)
Chart B  
Dim Logged Date
Measure Count(Issue no)

 

I wish to combine the view of both the charts in one single chart and dimension should change on click of   a button like below :-

Dim on basis of button selection
Measure  Count(issue no)

 

Can anyone please help me ?

Thanks 

Labels (1)
1 Solution

Accepted Solutions
Qlik_Eric_Thomas

Can you do something like this with IF Statements controlled by a variable input?

Qlik_Eric_Thomas_0-1669731945407.png

Dimension: =IF($(vDim)=1,Dim1,Dim2)
Expression: =IF($(vDim)=1,sum(Expression1),Sum(Expression2))

I'm not sure this will have the greatest performance in some scenarios but seems like it accomplishes the ask here.

Sr. Technical Support Engineer with Qlik Support
Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

5 Replies
brunobertels
Master
Master

Hi 

see this link last post with an qvf example about how to built this using variable

https://community.qlik.com/t5/New-to-Qlik-Sense/Nesting-Variables/m-p/2007030#M218638 

 

Another way is to create separately the 2 charts add them as master visualization then add them in a container object 

use button to show / Hide first or second chart in the container object 

 

Hop it helps 

Aspiring_Developer
Creator III
Creator III
Author

Hi @brunobertels 

Thanks for your response

I tried your approach but did not work. Also, I was looking for an alternate way to show the values in same graph in order to avoid two separate charts and putting them in a container.

 

Thanks

Qlik_Eric_Thomas

Can you do something like this with IF Statements controlled by a variable input?

Qlik_Eric_Thomas_0-1669731945407.png

Dimension: =IF($(vDim)=1,Dim1,Dim2)
Expression: =IF($(vDim)=1,sum(Expression1),Sum(Expression2))

I'm not sure this will have the greatest performance in some scenarios but seems like it accomplishes the ask here.

Sr. Technical Support Engineer with Qlik Support
Help users find answers! Don't forget to mark a solution that worked for you!
Aspiring_Developer
Creator III
Creator III
Author

Hi @Qlik_Eric_Thomas 

Thanks for your response. I was able to create tow buttons and using the variable toggled the dimension inside the chart. 

But how can I fix it to show the default value. Right now, when I click the button 1 it shows the value for that dimension , but when I am not selecting anything , it shows error in the chart.

How can I set to a default value ?

 

Thanks

Qlik_Eric_Thomas

With the expression I used: =IF($(vDim)=1,Dim1,Dim2)

If the vDim variable equals '1' then Dim1 is used else Dim 2 is used. So I suppose in this scenario the default value is Dim2.

I'm not sure where exactly your dashboard is having issue, here's a copy of the example.

Sr. Technical Support Engineer with Qlik Support
Help users find answers! Don't forget to mark a solution that worked for you!