Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

wisetrackchile
New Contributor

I am using "Color by expression" but the graphics are gray

Hi,

Please help me:

I am using "Color by expression" but the graphics are gray

The Dimension:

=if((DRIVERTIME < 341),'LOW',

    if((DRIVERTIME >= 341) And (DRIVERTIME < 361),'MEDIUM',

        if((DRIVERTIME >= 361),'HIGH')))

The Measure:

=Count(TRIPS)

Color by expression:


=if((DRIVERTIME < 341),Green(),

    if((DRIVERTIME >= 341) And (DRIVERTIME < 361),Yellow(),

        if((DRIVERTIME >= 361),Red())))

2017-07-19 13_09_20-192.168.1.61 - Conexión a Escritorio remoto.png

THANKS!!

Tags (1)
1 Solution

Accepted Solutions

Re: I am using "Color by expression" but the graphics are gray

Because the color expression is calculating over multiple rows, you must do some sort of aggregation over DRIVERTIME. As you have it now in the IF(), DRIVERTIME will return null when there are multiple rows. Try using "Avg(DRIVERTIME)" in your color expression.

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

7 Replies
bellamae
Valued Contributor

Re: I am using "Color by expression" but the graphics are gray

I would suggest finding the RGB value of the colour and using that e.g.

if("Gender"='Male',rgb(68,119,170),if("Gender"='Female',rgb(204,102,119), rgb(253,219,102)))

wisetrackchile
New Contributor

Re: I am using "Color by expression" but the graphics are gray

Bella, thanks

I also tried that option, but it does not work either

Rodrigo

Re: I am using "Color by expression" but the graphics are gray

Because the color expression is calculating over multiple rows, you must do some sort of aggregation over DRIVERTIME. As you have it now in the IF(), DRIVERTIME will return null when there are multiple rows. Try using "Avg(DRIVERTIME)" in your color expression.

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

prithviram777
New Contributor III

Re: I am using "Color by expression" but the graphics are gray

Please check if this might be the reason.

Are you using alternative dimension?

Snapshot.PNG

wisetrackchile
New Contributor

Re: I am using "Color by expression" but the graphics are gray

Eureka !!! That was the problem, thank you very much!!!

prithviram777
New Contributor III

Re: I am using "Color by expression" but the graphics are gray

If you found the document clip useful, please mark my response as correct or appropriate.

Thank you

mjtaft2017
Contributor

Re: I am using "Color by expression" but the graphics are gray

Please mark Rob Wunderlich's response as correct since you indicated that resolved your question.  I selected this question because it was still marked as unanswered - but upon reading it, you did get a correct response and it just needs to be marked.

Thank you.