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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Compare Text-Values

Hi all,

I compare two text fields and output the matches as a rank.
If it is found a word from the Text2 in Text1, it has the rank 1 if two words are then displayed Rank 2, etc.

I solve the above SubStringCount function.
How do I compare only words from the letters Text2 longer than 3?

input:
LOAD
nr,
text1
Resident art1;
LEFT Join LOAD
id,
text2
Resident art2;

output:
LOAD
nr,
id,
SubStringCount(text1,SubField(text2, ' ')) as rank
Resident input;

Example:

Text1: Lorem ipsum dolor sit amet, consetetur dolores sadipscing elitr.

Text2: At vero eos et accusam et justo duo dolores et ea rebum | Rang 1

Text2: Stet clita kasd gubergren, no sea takimata sanctus elitr ipsum amet | Rang 3

Is my script it right or do you have another idea?

Thanks!!!

1 Reply
tresesco
MVP
MVP

i think you would get output as 0,0,0,0,0,0,0,0,1,0,0,0 for rank for first string and those many separate records as well, because the subfield function generates one record for each substring that can be taken from a larger string with the delimiter.

Right now what i can suggest yor is : use a count function for another LOAD(after your previous Load) like:

LOAD id, Count(if(rank=1,rank)) as RANK

Resident ....... Group By id; // hope id is your Text ID

Hope this helps you.

Regards, tresesco