Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
mattdt1811
Contributor III
Contributor III

If Statement with Match and Left

Hi All,

I am trying to tidy up our data field for [NAME OF CONTACT]  as some records start with numbers and symbols.

I have tried using the below but it has not worked.

if(Match(Left([NAME OF CONTACT]),1)('1','2','3','+','#'),'N/A', [NAME OF CONTACT]) as [Main Contact],

Would someone be able to give me the correct expression?

Alternatively if some is able to give me the script for if left,1 is not ABCDEFG........ , N/A , [MAIN CONTACT] that would be even better.

Thank you.

Labels (4)
1 Solution

Accepted Solutions
Anil_Babu_Samineni

For your first approach, Should be

if(Match(Left([NAME OF CONTACT],1),'1','2','3','+','#'),'N/A', [NAME OF CONTACT]) as [Main Contact]

Second option, you want to get as below

If(Not FindOneOf(Left([NAME OF CONTACT],1),'ABCDEFG'), 'N/A', [MAIN CONTACT])

 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

1 Reply
Anil_Babu_Samineni

For your first approach, Should be

if(Match(Left([NAME OF CONTACT],1),'1','2','3','+','#'),'N/A', [NAME OF CONTACT]) as [Main Contact]

Second option, you want to get as below

If(Not FindOneOf(Left([NAME OF CONTACT],1),'ABCDEFG'), 'N/A', [MAIN CONTACT])

 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful