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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

set analysis query, with if statements. help needed!

Hi everyone,

I have a background colour expression:

=

if( RAGRating = 'Red',rgb(255,0,0),

if

(RAGRating ='Amber',rgb(255,128,0),

rgb

(51,204,102)

I would like to put a set analysis variable in it but am facing problems. my variabvle is $(vTask) which includes the set analysis. Can anyone think of a way in which I can implement this? I tried



=if( $(vTask) RAGRating = 'Red',rgb(255,0,0),

if

($(vTask) RAGRating ='Amber',rgb(255,128,0),

rgb(51,204,102)







Thanks in advance.

bc



1 Reply
stephencredmond
Partner - Specialist II
Partner - Specialist II

Hi,

Sets need to have a function to reside in (like Sum, Avg, Count, Min, Max, etc.) whereas you have a static IF statement with static values.

If the RAGRating value is a field, I might look at something like:

=if( MaxString ($(vTask) RAGRating) = 'Red',rgb(255,0,0), ...

Stephen