Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Color by Expression

Does anyone know the syntax to use the "color by expression" function  for multiple variables?

It's pretty simple for If the owner equals "Mr. Smith" then make him purple, if not make everything else gray.....

This syntax works for the the above. 

if([Owner]='Mr. Smith','purple','drkgray')

The issue is that I have 3 variables that I am trying to color code.  I am trying to do something specific:

Mr. Smith= purple

Mr. Jones=drkgray

Mr. Wallace= green.



Please help!

Thanks!!

12 Replies
sergio0592
Specialist III
Specialist III

Marco, i'd like understand why you use  : Dual(Colour, Evaluate(Colour&'()')) as Colour in your script.

I'am sure there is a very good reason because if i remove it from load statement and write Magenta(), DarkGray(), Green() in Colour, it won't works

Thanks for your answer.

MarcoWedel

Hi,

this expression generates a dual value (meaning having both text and numeric values).

The text part is the Colour string itself, while the numeric part is the result of the QlikView inbuilt colour function with the same name:

The string "Green" is extended to "Green()" and the result evaluated as a QlikView expression (see also: Color functions) in this case delivering the RGB Value "RGB(0,128,0)".

Hope this helps

regards

Marco

sergio0592
Specialist III
Specialist III

Thanks, it's very clear now!