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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how find the count of any 2 keywords in a particular string ?

Hi

I have a list of words with column name as keyword. I need to find the no  any two  keywords present in the particular description column what i have with me.

For ex:

List of keywords:

memory,

cpu,

access,

adobe,

outlook

etc

Description:

the cpu memory is full.  (here keywords are 2 )

unable to access outlook. (here keywords are 3 )

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try

MAP:

MAPPING

LOAD List, '%MATCH%' as F2 INLINE [

List

memory

cpu

access

adobe

outlook

];

LOAD *, SubStringCount(MapSubString('MAP',Text),'%MATCH%') as Count INLINE [

Text

the cpu memory is full.

unable to access outlook.

];

View solution in original post

22 Replies
Anonymous
Not applicable
Author

try match() like:

match(Fieldname,'CPU','Memory')

Not applicable
Author

Thanks for quick response

But i have a huge listed of keywords, They can be any two keywords, it is not restricted to particular two keywords.

Then how to derive the logic.?

swuehl
MVP
MVP

Try

MAP:

MAPPING

LOAD List, '%MATCH%' as F2 INLINE [

List

memory

cpu

access

adobe

outlook

];

LOAD *, SubStringCount(MapSubString('MAP',Text),'%MATCH%') as Count INLINE [

Text

the cpu memory is full.

unable to access outlook.

];

Anonymous
Not applicable
Author

Try to create a Inline table of your Keywords and do like Swuhi suggested

Not applicable
Author

hi

let me be clear my actual requirement is

I have a 200 list of keyword that are related to no action calls. I need to bring out a pie chart to show the count of action and no action calls.

These keywords are derived from the column called description in  a ticket dump.

i need to map these keywords list with the description and get the count of any two keywords. and generate the chart accordingly. with respective to ticket count.

swuehl
MVP
MVP

Could you post a small sample QVW? Or could you describe where the suggested solution fails your requirements?

Not applicable
Author

hi

please find the attachment, here in the attached qvd i am trying to bring out the tickets that have action and no action calls in pie chart.

swuehl
MVP
MVP

Seems like you followed my suggestions and created the Count using substringcount / mapsubstring.

I can't see if the search is correct, because the MAP itself is removed from the data model after the load, but the count returned some values. The field name you used for the count is 'MatchString'.

Field values are counts of matching search values, 0, 1, 2 and 3.

What I have not understood is your last load:

LOAD TicketID,

    Description,

    MatchString,

      if(wildmatch( MatchString, '%MATCH')>=0,'NoActionCalls' ,  'ActionCalls')  as Tickets

FROM

(qvd);

Since MatchString is a number, why use a wildmatch here? and why test for larger equal zero?

Maybe you want

LOAD TicketID,

    Description,

    MatchString,

      if( MatchString>0,'NoActionCalls' ,  'ActionCalls')  as Tickets

FROM

(qvd);

Not applicable
Author

sorry it was by mistake to include the wildmatch, and if I am trying to load as if( MatchString>0,'NoActionCalls' ,  'ActionCalls')  as Tickets then to i am unable to check for no action and action calls.