Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Hello everyone!
Is it possible to use only 2nd, 3rd, 4th from the top of selected values in listbox?
For example: I'd like to use 2nd or 3rd value from the top of selected values in listbox and use it as a dimension in table with Alternate State.
 
					
				
		
 jagan
		
			jagan
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
Try like this
Dimension: YourField
Expression: Sum({<YourField={"$(=Subfield(Concat(Distinct YourField, ';'), ';', 2))", "$(=Subfield(Concat(Distinct YourField, ';'), ';', 3))" }>} Measure)
Hope this helps you.
Regards,
Jagan.
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		One way to get
2nd value - Subfield(Concat(Distinct YourField, ';'), ';', 2)
3rd value - Subfield(Concat(Distinct YourField, ';'), ';', 3)
Note, here sorting of the field values/load order would play an important role to decide which value comes first but the order of selection.
 
					
				
		
I know  But how can I use it as a dimension?
 But how can I use it as a dimension?
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Could you please share a sample qvw explaining the requirement a bit more in detail?
 vincent_ardiet
		
			vincent_ardiet
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
You can try to use a IF in your dimension which can be poor in performance but it depends on the size of your application.
For example with something like this in the dimension expression and a dimension limit to have only 2 values displayed:
=if(match(NAME,$(=mid(concat({$}distinct NAME,chr(39)&','&chr(39)),index(concat({$}distinct NAME,chr(39)&','&chr(39)),chr(39)&','&chr(39))+2)&chr(39))),NAME)
 
					
				
		
 
					
				
		
 jagan
		
			jagan
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
Try like this
Dimension: YourField
Expression: Sum({<YourField={"$(=Subfield(Concat(Distinct YourField, ';'), ';', 2))", "$(=Subfield(Concat(Distinct YourField, ';'), ';', 3))" }>} Measure)
Hope this helps you.
Regards,
Jagan.
 
					
				
		
 jagan
		
			jagan
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Please find attached file for solution.
Regards,
Jagan.
 
					
				
		
Dimension: YourField
Expression: Sum({<YourField={"$(=Subfield(Concat(Distinct YourField, ';'), ';', 2))","$(=Subfield(Concat(Distinct YourField, ';'), ';', 3))" }>} Measure)
That helped. Thank you 
