Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 Aspiring_Develo
		
			Aspiring_DeveloHi 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
 Qlik_Eric_Thoma
		
			Qlik_Eric_ThomaCan you do something like this with IF Statements controlled by a variable input?
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.
 
					
				
		
 brunobertels
		
			brunobertels
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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_Develo
		
			Aspiring_DeveloThanks 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_Thoma
		
			Qlik_Eric_ThomaCan you do something like this with IF Statements controlled by a variable input?
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.
 Aspiring_Develo
		
			Aspiring_DeveloThanks 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_Thoma
		
			Qlik_Eric_ThomaWith 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.
