Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
qvqfqlik
Creator
Creator

Identify character in a string

I am trying to to identify a  character in a string

eg: SXOWERF, STOFGHJK

for the example strings, I am trying to identify if the 2nd character in them is/is not 'X' or 'T'.

Please help me with this

Labels (1)
5 Replies
sunny_talwar
MVP
MVP

May be like this:

If(Match(Mid(FieldName, 2, 1), 'X', 'T'), 'Matched X or T', 'Did not Match X or T')

sunny_talwar
MVP
MVP

Here is a screenshot

Capture.PNG

You can replace True and False statements based on your requirement.

Best,

Sunny

qvqfqlik
Creator
Creator
Author

I am trying to exclude all such strings with 2nd charater 'X','T'  from the Field values. How to achieve this?

sunny_talwar
MVP
MVP

In the script, you can do this:

LOAD *

FROM ...

WHERE Match(Mid(FieldName, 2, 1), 'X', 'T') = 0;

saimahasan
Partner - Creator III
Partner - Creator III

You can use

if(Match(Mid(FieldName, 2, 1), 'X', 'T'),null(),FieldName)