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

Set a string variable that include both single code and double code

Hi,

I know that Qlikview can use both single code and a double code for a declaring a string. Bu what if I need to declare a string with both single and double code as part of the string.

For Example:

Following is the string:

I said "Don't go to there again!"

I need to define a string that store the whole line. What can  I do?

Thanks !

Elim

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Try this code.

Way1:

Load * inline [

Data

I said "Don't go to there again!"

];

Way2:

Load '"I said '&'Don'&Chr(39)& 't go to There Again!"' as Field

AutoGenerate 1;

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

3 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Try this code.

Way1:

Load * inline [

Data

I said "Don't go to there again!"

];

Way2:

Load '"I said '&'Don'&Chr(39)& 't go to There Again!"' as Field

AutoGenerate 1;

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
vinieme12
Champion III
Champion III

You would be using the ASCII codes for those literals

example

vString  ='I said'&chr(34)&'Don'&chr(39)&'t go to there again!'&chr(34)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
maxgro
MVP
MVP

A different solution could be

SET vSingleAndDoubleQuote = [aaa ' bbb " ccc];

Here you can read the explanation

Escape sequences