Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

Color By Expression Question!!!

This is my current color expression:

if([Fundamental Towing & Job Rating with iShowroom (SSJR03WB)]='L' or [Fundamental Towing & Job Rating with iShowroom (SSJR03WB)]='S' or [Fundamental Towing & Job Rating with iShowroom (SSJR03WB)]='N', lightred(), lightgray())

Which gives me this...

However, I want to be able to give it a color range.

I want "N" to be lightred() and I want S to be an ORANGE color and L to be yellow().

How do I write or modify the above expression to get that?

1 Solution

Accepted Solutions
sunny_talwar
Not applicable

Re: Color By Expression Question!!!

You can use ARGB() function to use a variation...

If([Fundamental Towing & Job Rating with iShowroom (SSJR03WB)]='L', ARGB(150, 255, 0, 0),

If([Fundamental Towing & Job Rating with iShowroom (SSJR03WB)]='S', ARGB(200, 255, 0, 0),

If([Fundamental Towing & Job Rating with iShowroom (SSJR03WB)]='N', ARGB(255, 255, 0, 0), LightGray())))

You can play around with the first argument of ARGB() to make it brighter or lighter. Higher number is brighter, and lower number as lighter

6 Replies
sunny_talwar
Not applicable

Re: Color By Expression Question!!!

May be this

If([Fundamental Towing & Job Rating with iShowroom (SSJR03WB)]='L', Yellow(),

If([Fundamental Towing & Job Rating with iShowroom (SSJR03WB)]='S', RGB(255,128,0),

If([Fundamental Towing & Job Rating with iShowroom (SSJR03WB)]='N', LightRed(), LightGray())))

Not applicable

Re: Color By Expression Question!!!

Hi Sunny,

Okay, that worked. But I don't actually like the feel of it like I thought I was going to.

If there a way to do a variation or lightred? So N would be light red and S would be a little lighter then lightred and S would be the lightest?

sunny_talwar
Not applicable

Re: Color By Expression Question!!!

You can use ARGB() function to use a variation...

If([Fundamental Towing & Job Rating with iShowroom (SSJR03WB)]='L', ARGB(150, 255, 0, 0),

If([Fundamental Towing & Job Rating with iShowroom (SSJR03WB)]='S', ARGB(200, 255, 0, 0),

If([Fundamental Towing & Job Rating with iShowroom (SSJR03WB)]='N', ARGB(255, 255, 0, 0), LightGray())))

You can play around with the first argument of ARGB() to make it brighter or lighter. Higher number is brighter, and lower number as lighter

Not applicable

Re: Color By Expression Question!!!

Thank you SUNNY!

Not applicable

Re: Color By Expression Question!!!

Hi Sunny,

I searched this post hoping to find an answer (similar to what you did for Lauren).

Instead of color ranges, i tried to substitute with colors:

If([Fundamental Towing & Job Rating with iShowroom (SSJR03WB)]='L', purple(),

If([Fundamental Towing & Job Rating with iShowroom (SSJR03WB)]='S', green(),

If([Fundamental Towing & Job Rating with iShowroom (SSJR03WB)]='N', darkgray(), LightGray())))


When I did so, it didn't work what am i doing wrong?

Thanks!

amonjaras
Not applicable

Re: Color By Expression Question!!!

Hello Pauline,

purple() is not a valid color function. You can try cyan() instead.

Regards.