Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
pick(WildMatch([Customer Name], '*WALMART*', '*TARGET*', '*'), 'Walmart', 'Target', 'Other')
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 ?
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.
pick(WildMatch([Customer Name], '*WALMART*', '*TARGET*', '*'), 'Walmart', 'Target', 'Other')