Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 sridhar_sigired
		
			sridhar_sigired
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
I have nested if condition something like below (too nested).
IF (A like 'AZK*' , 'Azzar',
IF (A like 'VDN*' , 'Vodapone',
IF (A like 'WB*' , 'WorldBlue',
IF (A like 'wow*' , 'WOW! Security',
IF (A like 'ZA*' , 'ZoneAlarm',
IF (A like 'ys*' , 'sdgrsw',
'Unknown')))))
Can i use Match or any other function to avoid this nested IF??? for better performance?
Regards,
Sridhar
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Pick(WildMatch(A ,'AZK*' , 'VDN*','WB*','wow*','ZA*', 'ys*')+1, 'Unknown', 'Azzar', 'Vodapone','WorldBlue','WOW! Security', 'ZoneAlarm','sdgrsw')
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Try this:
Pick(WildMatch(A, 'AZK*', 'VDN*', 'WB*', 'wow*', 'ZA*', 'ys*', A), 'Azzar', 'Vodapone', 'WorldBlue', 'WOW! Security', 'ZoneAlarm', 'sdgrsw', 'Unknown')
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Pick(WildMatch(A ,'AZK*' , 'VDN*','WB*','wow*','ZA*', 'ys*')+1, 'Unknown', 'Azzar', 'Vodapone','WorldBlue','WOW! Security', 'ZoneAlarm','sdgrsw')
 sridhar_sigired
		
			sridhar_sigired
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		May i know why we have used +1 here?
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		If there would be no match, wildmatch() would return 0, otherwise it's match index . By adding 1 to 0, pick() is told to pick the 1st text, i.e- 'Unknown'. For rest of the matched values, position is deferred by 1. Hope this helps.
 sridhar_sigired
		
			sridhar_sigired
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Sunny,
Unknown used here as for if not else, not to replace as 'A'. Can you clear the confusion?
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		In the new field that will be created you want it to be called 'Unknown', if it doesn't match any other names that we listed within WildMatch()?
 sridhar_sigired
		
			sridhar_sigired
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		OK Let me try yours and from tresesco. And take the one which is working. Thank you.
