Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

muniyandi
Contributor III

How to count char

Hi,

how to count the char, how many times in the field.

Ex: ('abcd,efgh,ijklm,nopqrs,tuvwxyz',',') i want Result  4

('abcd,efgh,ijklm,nopqrs,tuvwxyz','a') i want result 1

Thanks,

Muni

1 Solution

Accepted Solutions
Sokkorn
Honored Contributor

Re: How to count char

Hi Muni,

=SubStringCount('abcd,efgh,ijklm,nopqrs,tuvwxyz',',') -> will return 4

=SubStringCount('abcd,efgh,ijklm,nopqrs,tuvwxyz','a') -> return 1

Regards,

Sokkorn

7 Replies
sunilkumarqv
Valued Contributor II

Re: How to count char

We are not geeting you Please explore what need to ask

Not applicable

Re: How to count char

try

substringcount( text , substring)

Returns the number of times the string substring appears within the string text. The result is an integer. If there is no match, 0 is returned

Example:

substringcount ( 'abcdefgcdxyz', 'cd' ) returns 2

Sokkorn
Honored Contributor

Re: How to count char

Hi Muni,

=SubStringCount('abcd,efgh,ijklm,nopqrs,tuvwxyz',',') -> will return 4

=SubStringCount('abcd,efgh,ijklm,nopqrs,tuvwxyz','a') -> return 1

Regards,

Sokkorn

Not applicable

Re: How to count char

hi

substringcount( text , substring)

Returns the number of times the string substring appears within the string text. The result is an integer. If there is no match, 0 is returned

Example:

substringcount ( 'abcdefgcdxyz', 'cd' ) returns 2

sunilkumarqv
Valued Contributor II

Re: How to count char

Sokkorn is correct

Not applicable

Re: How to count char

Hi Mathew,

Let Inde=IndexLet Inde1=Index('abcd,efgh,ijklm,nopqrs,tuvwxyz','a');

Let Inde1=Index(''abcd,efgh,ijklm,nopqrs,tuvwxyz','a',1);

Let Inde2=Index(''abcd,efgh,ijklm,nopqrs,tuvwxyz','a',2);

Hope this will help you

Regards,

DJ

muniyandi
Contributor III

Re: How to count char

Hi All,

Sokkorn answer is correct


Thanks to all.

Muni

Community Browser