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: 
50ShadesOfSalty
Partner - Contributor III
Partner - Contributor III

Filtering a field in Set Analysis with '' in the string value

Hello everyone,

 

I'm currently having an issue filtering a value that has '' in the string.

 

For example, consider the following example:

ID | NAME

1 | Mike

2 | Paul

3 | Robinson

4 | Owen 'The Flash'

5 | John 'The Cool'

 

When i try to: Sum( {< [NAME]={'Mike', 'Paul'} >}[Sales]), all works as it should.

Now, if i try to do Sum( {< [NAME]={'Owen 'The Flash''} >}[Sales]), i encounter an error because of the ' that are inside of the string value that i want to filter.


Also, here are some examples that i tried in order to overcome this issue:

'Owen '&chr(39)&'The Flash'&chr(39)

$(=chr(39)&'Owen '&chr(39)&'The Flash'&chr(39)&chr(39))

 

Any help for this issue is highly apreciated, as long as i'm having some troubles with this issue!

 

Thanks,

50ShadesOfSalty

Labels (6)
1 Solution

Accepted Solutions
veidlburkhard
Creator III
Creator III

Hi,

try

Sum( {< [NAME]={"Owen 'The Flash'"} >}[Sales])

This should work.

Regards

Burkhard

View solution in original post

3 Replies
veidlburkhard
Creator III
Creator III

Hi,

try

Sum( {< [NAME]={"Owen 'The Flash'"} >}[Sales])

This should work.

Regards

Burkhard

petter
Partner - Champion III
Partner - Champion III

If you still want to do a string literal match and not a string search then you can do it by escaping the character by having it twice like this:

 

Sum( {< [NAME]={'Owen ''The Flash'''} >}[Sales])

Notice that there are only single quotes in there - not double quotes although it might look like it...

Sum( {< [NAME]={"Owen 'The Flash'"} >}[Sales])

Will also work although this is a search and not a match - and it is case-insensitive whereas using single quotes will be case-sensitive...

 

50ShadesOfSalty
Partner - Contributor III
Partner - Contributor III
Author

This actually worked! 

Thank you!