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: 
AB01
Contributor II
Contributor II

How to show identical match in straight table for string in more than one field?

Hi, I'm trying to create a straight table which shows keyword likeness to search terms. E.g. search term = apple, keyword = apple.

I want the table to show all values as well as state in a separate field whether the search term and keyword match with a true/false statement.

Fields are as follows; [Search term], [Match type], Keyword

I've tried this expression: if([Search term] >= Keyword,1) with no luck.

Any help is much appreciated. Thanks in advance.

1 Solution

Accepted Solutions
benvatvandata
Partner - Creator II
Partner - Creator II

Mmm... try switching the formula to: 

=if( [Search term] LIKE '*' & Keyword & '*' or Keyword LIKE '*' & [Search term] & '*', 1, 0)

And then in the presentation tab, uncheck 'Suppress Zero-Values':

benvatvandata_0-1615908864802.png

 

 

View solution in original post

4 Replies
edwin
Master II
Master II

you can use the = condition if you expect the string as the whole field or use substringcount function if part of the field
SubStringCount - script and chart function ‒ QlikView

 

benvatvandata
Partner - Creator II
Partner - Creator II

You could try creating a chart with [Search term] and [Keyword] as dimensions, and add the following as an expression: 

=if( [Search term] LIKE '*' & Keyword & '*' or Keyword LIKE '*' & [Search term] & '*', 1)

 

AB01
Contributor II
Contributor II
Author

Thanks for this. Seems to have got me about half way there! So now it is showing all the terms which have a LIKE match, but need to also see the terms which do not match (these are keyed so can be differentiated). I've tried placing 'NOT' after the 'IF(' but that doesn't seem to work. Any ideas? Thanks.

Current result:

AB01_1-1615901308060.png

 

 

benvatvandata
Partner - Creator II
Partner - Creator II

Mmm... try switching the formula to: 

=if( [Search term] LIKE '*' & Keyword & '*' or Keyword LIKE '*' & [Search term] & '*', 1, 0)

And then in the presentation tab, uncheck 'Suppress Zero-Values':

benvatvandata_0-1615908864802.png