Skip to main content

App Development

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

Announcements
Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
wisetrackchile
Contributor
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!!

Labels (1)
1 Solution

Accepted Solutions
rwunderlich

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

View solution in original post

7 Replies
bellamae
Specialist
Specialist

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
Contributor
Contributor
Author

Bella, thanks

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

Rodrigo

rwunderlich

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
Partner - Contributor III
Partner - Contributor III

Please check if this might be the reason.

Are you using alternative dimension?

Snapshot.PNG

wisetrackchile
Contributor
Contributor
Author

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

prithviram777
Partner - Contributor III
Partner - Contributor III

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

Thank you

mjtaft2017
Partner - Creator
Partner - Creator

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.