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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Match string values with single quote characters

I need to set a flag in my script where a field equals 1 of 3 specific strings. 2 of those strings have an apostrophe in them, and I cannot change them. (in fact 1 string uses chr(39) and the other uses chr(8217) )

So, I used a combination of Match and Purge to deal with the apostrophe characters and test if the field matches. This works for the 2 fields with the apostrophes, nut not for the 'No show' option. What am I missing?

if(match(PurgeChar(PurgeChar([Cancellation Reason],chr(39)),chr(8217)),'No Show','Rescheduled – Client didnt show up','Cancelled - Client didnt show up')>0,1) as fCancelReasonNoShow

or is there a simpler way to achieve this?

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Hi Derek,

Have you tried WildMatch!! Can you post here  [Cancellation Reason] field values (sample)?

View solution in original post

6 Replies
tamilarasu
Champion
Champion

Hi Derek,

Have you tried WildMatch!! Can you post here  [Cancellation Reason] field values (sample)?

datanibbler
Champion
Champion

Hi Derek,

I'd guess you have to get rid of the blank space. It might be a possibility to REPLACE() this with an underscore so that you have the text all_in_one_piece? Otherwise, QlikView_functions might not work correctly because the second part of a string (after a blank space) is interpreted as a new parameter.

HTH

maxgro
MVP
MVP

try this

=match(trim(KeepChar(lower([Cancellation Reason]), 'no shw')), 'no show')

to test

=match(trim(KeepChar(lower('No ' & chr(39) & chr(8217) & 'Show'), 'no shw')), 'no show')

sasiparupudi1
Master III
Master III

I suggest you to load PurgeChar(PurgeChar([Cancellation Reason],chr(39)),chr(8217)) as a seperate field in the table to see if how your resultant string would look like.

Could you post some sample data?

HTH

Sasi

tamilarasu
Champion
Champion

Derek,

My first correct answer in this community. michael-jackson.gif happy-day-smiley-emoticon.gif to you.

Not applicable
Author

thanks for all the quick responses - Wildmatch fixes the issue.

For reference, the data I was trying to match in the [Cancellation Reason] field is

No Show      (no special characters)

Rescheduled – Client didn't show up   (apostrophe = chr(39))

Cancelled - Client didn't show up      (apostrophe = chr(8217))