Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SET evaluation

Hi

I have a variable (called YTDToggle) which contains either a 1 or a 0 and is used to toggle/keep track of something in the front end.  In the load script it gets assigned a default value of 1.

I am trying to create another variable using the SET statement which looks something similar to this:

SET myVar = 'pick($(YTDToggle),'something','something else');

Regardless of what syntax I choose the result end up like this:

myVar = 'pick(1,'something','something else');

How can I prevent the $(YTDToggle) evaluting to it's result, in this case 1?

Thanks

Oli

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try

Let myVar = 'pick($' & '(YTDToggle),''something'',''something else'')';


Note the two single quotes for esacping the single quotes around your literal strings.

View solution in original post

1 Reply
swuehl
MVP
MVP

Try

Let myVar = 'pick($' & '(YTDToggle),''something'',''something else'')';


Note the two single quotes for esacping the single quotes around your literal strings.