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: 
dgreenberg
Partner - Specialist
Partner - Specialist

Problem with where clause when names have an apostrophe

I am trying to pass ePartner to a where a clause.

Resident Sampling1

  where ePartner <> '[O'Mara,Jane J]';

I have tried brackets, double quotes and everything else I can think of.

I am currently using this

Let vPartnerB=chr(39) & chr(91) & peek('ePartner',$(vRand),'Sampling2') & chr(93) & chr(39);

But that fails when the name has an apostrophe as shown above.

I guess let's keep it simple and say how can I use a where clause with a name with an apostrophe

     where ePartner <> 'O'Mara, Jane J'

1 Solution

Accepted Solutions
dgreenberg
Partner - Specialist
Partner - Specialist
Author

Solved:

The best I could come up with is the replace the apostrophe with an ` chr(96)

Looks pretty close and doesn't fail.

replace(v1,chr(39),chr(96))

View solution in original post

1 Reply
dgreenberg
Partner - Specialist
Partner - Specialist
Author

Solved:

The best I could come up with is the replace the apostrophe with an ` chr(96)

Looks pretty close and doesn't fail.

replace(v1,chr(39),chr(96))