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: 
Thomas_Spitzer
Contributor III
Contributor III

How to display a variable's original string value with a single quote and/or a variable $ placeholder

I define following variables:
Let myVar1 = 'this var contains a single quote ' & Chr(39) & ' character.';
Let myVar2 = 'this var contains a ' & Chr(36) & '(anotherVar) placeholder.';

Then the resulting string value of myVar1 will be:
this var contains a single quote ' character.

And the resulting string value of myVar2 will be:
this var contains a $(anotherVar) placeholder.

So far, so good.

Now I want to display the variables string value as information for the user in a qlik sense app (for example in an text & image visualization). The result should be exacly as the var string values above with the single quote an the not replaced $(anotherVar) expression, something like this:

The string value of myVar1 is: this var contains a single quote ' character.
The string value of myVar2 is: this var contains a $(anotherVar) placeholder.

The following (of course) does not work:

= 'The string value of myVar1 is: ' & '$(myVar1)'
= 'The string value of myVar2 is: ' & '$(myVar2)'

I've looked intensively but did not found any way to do this. 

Any solution?

1 Reply
Saravanan_Desingh

May be try like this.

Set myVar1 = 'this var contains a single quote ' & Chr(39) & ' character.';
Set myVar2 = 'this var contains a ' & Chr(36) & '(anotherVar) placeholder.';

= 'The string value of myVar1 is: ' & '$(myVar1)'
= 'The string value of myVar2 is: ' & '$(myVar2)'

Or

Set myVar1 = 'this var contains a single quote ' & Chr(39) & ' character.';
Set myVar2 = 'this var contains a @(anotherVar) placeholder.';

Let myVar3 = Replace(myVar2,'@','$');

= 'The string value of myVar1 is: ' & '$(myVar1)'
= 'The string value of myVar2 is: ' & '$(myVar3)'