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.

mmainiero
Not applicable

Count Phrase in List

Hi, I would like to count the appearance of a word in a List of Sentences.


List:


Number     Phrase

1                Hello World

2                Qapla

3                the force awakens

4                the force may be with you

5                The Storm


Now I want to count for example “force” or “the”.


Force should be (2) and the (3)

I have tried

=SubStringCount(PHRASE,'force')

=count({<PHRASE={'force'}>}Number)

1 Solution

Accepted Solutions
ahaahaaha
Not applicable

Re: Count Phrase in List

Hi Markus

=substringcount(Concat(Phrase), 'force')

If words can begin with a capital letter, use, for example, function lower()

=substringcount(Lower(Concat(Phrase)), 'the')

Regards,

Andrey

2 Replies
tresesco
Not applicable

Re: Count Phrase in List

Try with wildcard search, like:

=count({<Phrase={'*force*'}>}Number)

ahaahaaha
Not applicable

Re: Count Phrase in List

Hi Markus

=substringcount(Concat(Phrase), 'force')

If words can begin with a capital letter, use, for example, function lower()

=substringcount(Lower(Concat(Phrase)), 'the')

Regards,

Andrey