Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jim_chan
Specialist
Specialist

Create keywords(*BUSINESS*) from column data.

Hi guys,

i wanted to create a keyword field from 1 of my existing field. The existing field is business_description where it contains long desvcription.

So i want to create a keywords list box, pick up some words from each of the description .

at the loading script, i've wrote.

If ( business_desc = '*Food*' , 'About Food' , Null() ) as Keywords.

When I loaded the script, i have found that the keywords list box is empty! no data!

So, my script is wrong?

Rgds,

Jim

11 Replies
jim_chan
Specialist
Specialist
Author

Hello , marco?

MarcoWedel

Hi,

depending on your requirements one solution could be:

QlikCommunity_Thread_238143_Pic1.JPG

final_survey:

LOAD *,

    If(survey_desc like '*chiken*beef*lamb*', 'chicken and beef and lamb',

        If(survey_desc like '*chili*CHICKEN*', 'chili chicken' ,

          If(survey_desc like '*lamb*', 'lamb',Null() ))) as keywords

Resident survey;

DROP Table survey;

So just change the order of your nested if() functions according to the priority you wish.

'*lamb*' in this case only becomes relevant if the string is NOT like '*chiken*beef*lamb*'  (note the chicken typo in your example).

hope this helps

regards

Marco