Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Generate new table based on resident

Hi Guys,

I'm sure this is a simple question, but I am having a mind blank, hopefully someone can help me.

I have an existing table with a description (text) field.  I want to generate a new table that has the UID and a few specific words I find in the description field with duplication (i.e. a new row per word that I'm searching for).

So for example with 1 row:

ID, Text

AA, The quick brown fox jumps over the lazy dog

I would use the wildmatch to search for the words of interest, in this case I'm searching for brown, over and lazy.

So I want another table to generate that links on ID that would now have 3 rows because I found my 3 words:

ID, Wordmatch

AA, brown

AA, over

AA, lazy

Can anyone think of an ingenious way to do this efficiently?

Thanks

Gareth

20 Replies
pat_agen
Specialist
Specialist

hi,

that is a long time ago!

I think I meant as below  (untested)

for each Keyword in 'word','best'

     Keywords:

     load ID,

     if(isnull(wildmatch(Text,'*$(Keyword)*')), null(), '$(Keyword)') as Wordmatch

     resident File

     where wildmatch(Text,'*$(Keyword)*'))>0;

next;

at the time I though the original code would create a record each time it found one of your keywords, as per youir requirement, but would also gerate a record with an empty vamue in the fielWordmatch when the keyword was absent from the field Text.

The where clause shouldvoid creating these empty records.

This may or may not be required. test yourself to make sure you are getting the results you want.

good luck