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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
robin_heijt
Creator
Creator

Adding a background color to a pivot table

Hi,

I would like to know how to color the background of a straight table based on multiple conditions.

 

My data source is the following:

Dimension 1 = Year

Dimension 2 = Band

Measure = Total Population

 My desired outcome:

if("year"='2011' and [Band Unified]='ALL', rgb(255, 0, 0),//Red
if("year"='2011' and [Band Unified]='VII', rgb(255, 0, 0),//Red
if("year"='2011' and [Band Unified]='VI', rgb(255, 0, 0),//Red
if("year"='2011' and [Band Unified]='V', rgb(255, 192, 0),//Orange
if("year"='2011' and [Band Unified]='IV', rgb(146, 208, 80),//Green
if("year"='2011' and [Band Unified]='III', rgb(91, 155, 213),//Blue

............

Using this expression the output is as followed:

Capture.PNG

However now this also adds not existing null values.

Without the color expression, the table looks like this:

Capture.PNG

 

What do I need in my expression to show the colors in a proper way?

 

3 Replies
dplr-rn
Partner - Master III
Partner - Master III

Did you try if(isnull(yourmeasure),, if("year"='2011' and [Band Unified]='ALL', rgb(255, 0, 0),//Red......................
robin_heijt
Creator
Creator
Author

Yes, unfortunately that did not work. It still shows non-existing values.

Thanks anyhow.
dplr-rn
Partner - Master III
Partner - Master III

can you share a sample app?