Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
mattdt1811
New 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.

Tags (4)
Labels (4)
1 Solution

Accepted Solutions

Re: If Statement with Match and Left

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])

 

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
1 Reply

Re: If Statement with Match and Left

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])

 

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)