
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quotation marks in a variable in load script editor
Hi, don't ask why but i need to have a variable in the script editor with this value:
set vBackgroundColor= if(GetFieldSelections(name)='mario',hex_color, vBackgroundColor) ;
and then in the background color settings in a button I need to put this variable.
is this possible? i'm having problems because of the ' '
- Subscribe by Topic:
-
Data Load Editor
-
dimension
-
expression
-
General Question
-
Qlik Sense
-
Script
-
Variables

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
what color you want to display if mario not selected in the name field?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
set vBackgroundColor= if(GetFieldSelections(name)='mario',red(), blue()) ;


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may try to wrap the variable-content with double-quotes, like:
set vBackgroundColor= "if(GetFieldSelections(name)='mario',hex_color, vBackgroundColor)";

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This works for me:
set vBackgroundColor = "=if(GetFieldSelections(name)='mario',Red(),Blue())";
Note the = sign inside the double quotes.
(Hat tip to an old post by @hic Solved: Conditional variable - Qlik Community - 928539)
But if itsa-not-Mario, you are trying to set vBackgroundColor to itself and I don't know how successful that will be.
