Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Qlik Highlights 2020 Giveaway! Watch, reply and have a chance to win a $200 Amazon Gift Card! Watch Video
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor II
Contributor II

Set Variable in Scrip vs Dashboard

Hi,

I have i problem. The variable works in the dashboard but not in the script. It looks like it cuts of my ' in the end, why?

Script:

Script.png

Dashboard(Script):

Script - dontwork.png

Dashboard Script(and works):

Dashboard-Works.png

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

To represent a quote within the string, code the single quote twice. So a pair of single quotes would be coded as.

LET v1 = 'if(x,y,'''')';

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

View solution in original post

6 Replies
MVP & Luminary
MVP & Luminary

Try it with:

set = "YourExpressionIncludingSomeSingleQuotes";

- Marcus

Contributor II
Contributor II

Hi,

The script runs without error, but the variable dashboard is blank..

Screenshot 2016-09-06 08.14.07.png

Specialist
Specialist

Hi Sebastian, it's as Marcus said. Please have a look to this:

LET and SET

That may clarify the difference in using SET and LET

Hope it helps,

Andrés

Master III
Master III

You can try

let vPackCare='if(len(RavaraNr)=5 and Left(RavaraNr,1)=3,sum(levAntalRavara)/ArtikelVikt),'& chr(39)& chr(39)&')';

MVP & Luminary
MVP & Luminary

To represent a quote within the string, code the single quote twice. So a pair of single quotes would be coded as.

LET v1 = 'if(x,y,'''')';

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

View solution in original post

Contributor II
Contributor II

Thanks works now!