Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Sky_qlik
Contributor
Contributor

If statement determined by varaible value

Hi, I am trying to set a rule to highlight the text box depends on the variable value

Below are my draft script:

if(vOn='Y',rgb(0,255,0),rgb(255,255,255)

value for vOn: 'Y'

It appears that always 'else' expression is shown (white background)

The statement seems to be worked when I change the value of vOn to Y instead of 'Y'. I think it should be quotation problem. But what should I do to my script if I really want to use 'Y' as the variable value.

Prior thanks.

Labels (1)
1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Use pairs of single quotes to embed them in the condition:

=if(vOn = '''Y''', rgb(0,255,0), rgb(255,255,255)
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

1 Reply
jonathandienst
Partner - Champion III
Partner - Champion III

Use pairs of single quotes to embed them in the condition:

=if(vOn = '''Y''', rgb(0,255,0), rgb(255,255,255)
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein