Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
arsenal1983
Creator
Creator

Text string function

Hello,

I have column with partner ID and I would like to flag in my script partners with prefix ZD and the numer on the third place (ZD0, ZD3, ZD9 but without ZDQ).

any suggestions?

Luke

1 Solution

Accepted Solutions
maxgro
MVP
MVP

if(left([partner ID],2) = 'ZD' and match(right([partner ID],1),1,2,3,4,5,6,7,8,9,0), 'Yes','No') as flag

View solution in original post

9 Replies
ramoncova06
Specialist III
Specialist III

maybe something like

if(left(partner ID,3) <> 'ZDQ' and left(partner ID,2) = 'ZD', 'Yes','No') as ZDFlag

swuehl
MVP
MVP

If( Left( ID, 2) = 'ZD' and isnum(mid( ID, 3,1)), 'Yes','No') as Flag

maxgro
MVP
MVP

if(left([partner ID],2) = 'ZD' and match(right([partner ID],1),1,2,3,4,5,6,7,8,9,0), 'Yes','No') as flag

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Just because I've always wanted to find a use for the "precedes" operator:

=TextBetween([Partner ID],'ZD','') precedes 'A'

-Rob

http://masterssummit.com

http://robwunderlich.com

rbecher
MVP
MVP

..but watch out, help means precedes operator is using ASCII Comparison, but it's not:

= '9' precedes ':'    => false

but

= ord('9') < ord(':')  => true

So, my guessing is some other internal order is used.

Astrato.io Head of R&D
MarcoWedel

another one:

IsNum(Num#(partnerID,'ZD0'))

hope this helps

regards

Marco

MarcoWedel

QlikCommunity_Thread_167635_Pic1.JPG

swuehl
MVP
MVP

Unfortunately, this also accepts codes with second char being any number like:

=isNum(Num#('Z17','ZD0')) 

Probably because 'D' is a format code coincidentially.

MarcoWedel

'D1' also is flagged.

Maybe not the best solution after all

thanks

Marco