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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count how many times a char is repeated on a string??

Hi

I want to know if there’s a function or a way to count how many times a char is repeated on a string

For example:

“aaa-bbb-ccc-ddd-eee” I want to count the ( - ) how manytimes in this example is 4

Thanks,

1 Solution

Accepted Solutions
Not applicable
Author

I Found the answerd

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

View solution in original post

3 Replies
Not applicable
Author

I Found the answerd

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

stevelord
Specialist
Specialist

Thanks, saved me from having to ask or go down the rabbit hole of a manual.   Correct Answer points completely well-earned even when self-awarded.

Anonymous
Not applicable
Author

The answer is always into a good question.