Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 richard_chilver
		
			richard_chilverI wish to design a button which toggles between including and excluding a defined selection.
Whatever selections had already been made, the button would include data where (let's say) Field1 = 'A' and Field2 <> 'B'. When the button was clicked again, it would reverse this.
I have looked at using Toggle Select and also at Alternate States but I'm not clear whether these do the job.
I have considered having 2 buttons which are displayed conditionally, but this doesn't seem very elegant.
Any ideas would be welcome.
Thanks
 
					
				
		
 alexandros17
		
			alexandros17
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		in the field (of select in field) write your field, in the bottom box write:
=If(GetFieldSelections(Field)='A', '<> B', 'A')
 
					
				
		
 alexandros17
		
			alexandros17
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		1) define a variable in the script: LET vToggle = '1';
2) Add the button: Write in the General Tab -> Text: If(vToggle=1, 'Condition 1', 'Condition 2')
3) in the Action Tab ->External -> Set variable Write in the upper box: vToggle, in the bottom box: If(vToggle=1,2,1)
4) in your chart (or table) write: If(vToggle=1, expression 1 (the one with field1 = A), expression 2 (The one with Field <> B)
let me know
 
					
				
		
 richard_chilver
		
			richard_chilverHi Alessandro
That's a neat way to build a toggle button, and I have used something similar a few times. But what I am struggling to do is find the correct actions within the Button properties.. I can use Select in Field. But I do not know how to base the selection on the value of the toggle variable, vToggle.
 
					
				
		
 alexandros17
		
			alexandros17
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		in the field (of select in field) write your field, in the bottom box write:
=If(GetFieldSelections(Field)='A', '<> B', 'A')
 
					
				
		
 richard_chilver
		
			richard_chilverWow, yes that seems to work.
That's a neat trick I have learnt today!
Thanks
