Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

jim_chan
Contributor III

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

1 Solution

Accepted Solutions

Re: Create keywords(*BUSINESS*) from column data.

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


see also: String operators


hope this helps


regards


Marco

11 Replies

Re: Create keywords(*BUSINESS*) from column data.

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


see also: String operators


hope this helps


regards


Marco

jim_chan
Contributor III

Re: Create keywords(*BUSINESS*) from column data.

you are right!

Re: Create keywords(*BUSINESS*) from column data.

Hi,

if you have a table of keywords, then another solution might be:

Subfield Function

hope this helps

regards

Marco

jim_chan
Contributor III

Re: Create keywords(*BUSINESS*) from column data.

Hi Marco,

I realised there's  a description like - Chili Chicken  and another one is Chili Paste Chicken.

I need to create a keyword that it can find both of this description. Can i write:

if ( business_desc like '*Chili* + '*Chicken*' , 'Spicy Chicken' , Null() ) as Keywords

Re: Create keywords(*BUSINESS*) from column data.

Hi,

you could try

if ( business_desc like '*Chili*Chicken*' , 'Spicy Chicken' ) as Keywords


regards


Marco

jim_chan
Contributor III

Re: Create keywords(*BUSINESS*) from column data.

how mnay keywords can i add in??? can i add more than 2 keywords, if yes, how should it looks like?

jim_chan
Contributor III

Re: Create keywords(*BUSINESS*) from column data.

Hi guys,

i have a situation as such, and i tried to add it in the loading script, is it possible?

(*Personnel*|*retain*) ?

Rgds

Jim

Re: Create keywords(*BUSINESS*) from column data.

can you please post some different examples of your source strings and keyword combinations as well as your expected result to create a sample application with?

thanks

regards

Marco

jim_chan
Contributor III

Re: Create keywords(*BUSINESS*) from column data.

Hi Marco,

here's the screenshot. i have also attached sample data.

screenshot.jpg

Here's my script :

final_survey:

load

*,

    If ( survey_desc like '*lamb*' , 'lamb' ,

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

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

  

      Null() ))) as keywords

    

      Resident survey;

    

      drop table survey;

now this one is not functioning -   If( survey_desc like '*chicken**beef**lamb*' , 'chicken and beef and lamb'.

i want to have when user choose chicken and beef and lamb from the listbox, then it should show me desriptions  that has chicken,beef and lam words.

rgds

jim