Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with substring function

Hi,


My problem is I want to compare the set of values of a field with a String.

I m getting problem with substring function.

I m using expression like

=SubStringCount(concat(KRMO_MODULE_NAME,','),'Enrollment')

it is working fine.but values of field KRMO_MODULE_NAME are:

Compliance
Data Management
Data Timeliness
Enrollment
Enrollment/Discontinuation
Monitoring
Monitoring Visits
Protocol Deviations
Queries
Safety
SDV

So if I m matching the  string with 'Enrollment' , so there are two values containg this part of string.

So it is giving incorrect result.

So which function should i use to compare for the exact substring.?

Need urgent help....

1 Solution

Accepted Solutions
Not applicable
Author

Hi, Try this..

=SubStringCount(concat(KRMO_MODULE_NAME,'@'),'@Enrollment@')

View solution in original post

5 Replies
Not applicable
Author

Hi, Try this..

=SubStringCount(concat(KRMO_MODULE_NAME,'@'),'@Enrollment@')

Not applicable
Author

Thanks Arun, It helps me. It is working correctly.

But one doubt what the symbol @ does here?

Not applicable
Author

Hi,

You can use any symbol here,

when it used in concat function, it will make string like @Enrollment@Enrollment/Discontinuation@....etc

So, if you search for @Enrollment@, only one value will be returned.

Not applicable
Author

And one more point,

you should use

=SubStringCount(concat(F1,'@'),'Enrollment@')

because, if Enrollment is first value, concat will return Enrollment@Enrollment/Discontinuation@...so it will return 0.

Try it by selecting Enrollment and Enrollment/Discontinuation in list box.

Not applicable
Author

Thanks Arun.. Its a great help for me.