Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 guruprem
		
			guruprem
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
I have [Customer Name] , which has individual customer names , now I would like write a logic for [Customer Group ]says that if [Customer Name] contains walmart then Group should be Walnmart, if it contains target then Group should be Target and so on.
Please suggest me the best approach for this logic.
 maxgro
		
			maxgro
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		pick(WildMatch([Customer Name], '*WALMART*', '*TARGET*', '*'), 'Walmart', 'Target', 'Other')
 
					
				
		
.png) JonnyPoole
		
			JonnyPoole
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Wildmatch() will leverage strings and wild cards and do a case insensitive search to find the right bucketing
if( wildmatch([Customer Name]),'*WALMART*','Walmart',
if( wildmatch([Customer Name] ,'*TARGET*','Target')
)
Are these buckets mutually exclusive or could some include both walmart and target ?
.png) 
					
				
		
 crystles
		
			crystles
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		if(wildmatch( [Customer Name],'*walmart*') =1, 'Walmart,
if(wildmatch( [Customer Name],'*target*')=1, 'Target,
)) as CustomerGroup
This should work. You can add as many Groups as you want with the same formula.
 maxgro
		
			maxgro
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		pick(WildMatch([Customer Name], '*WALMART*', '*TARGET*', '*'), 'Walmart', 'Target', 'Other')
