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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
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

5 Replies
sunny_talwar

May be like this:

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

sunny_talwar

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

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)