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: 
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

Labels (1)
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
Partner - Specialist III
Partner - Specialist III

maybe something like

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

swuehl
Champion III
Champion III

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
MVP
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
Partner - Master III
Partner - Master III

..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.

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine
MarcoWedel
MVP
MVP

another one:

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

hope this helps

regards

Marco

MarcoWedel
MVP
MVP

QlikCommunity_Thread_167635_Pic1.JPG

swuehl
Champion III
Champion III

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
MVP
MVP

'D1' also is flagged.

Maybe not the best solution after all

thanks

Marco