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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

finding a text string within another text string

Hi Guys

Please see my example below.

Is there any function i can use to find or test whether Field A is found in Field B?

Field AField B
aa,b,c

In this case it would be True or 1 etc.

Regards,

Magen

6 Replies
fkeuroglian
Partner - Master
Partner - Master

Hi

try wit Match()

see the example below

http://qlikshare.com/292/

http://community.qlik.com/message/483096#483096

Good Luck

Fernando

Not applicable
Author

Try the following expr:

=if(match(FieldA,subfield(FieldB,',')),1)

hope it will work..

Anonymous
Not applicable
Author

try this:

if ( substringcount(FieldB, FieldA)>0, 1,-1)

1 if found

-1 if not

menta
Partner - Creator II
Partner - Creator II

You can use index if >0 the field A is contained in field B


index( Field B, Field A )

rbecher
MVP
MVP

This is good but you should probably use the delimiter to be save:

substringcount(',' & FieldB & ',', ',' & FieldA & ',') > 0

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine
nizamsha
Specialist II
Specialist II

LOAD * Inline [

FieldA,FieldB

A,A

B,B;C

C,C

D,E

F,G

];

=if(Match(FieldA,SubField(FieldB,',',1)),FieldA,'Mis Match')