Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Coloring the background cells in Pivot Table based on value in cell

Hi,

I have dimensions listed s RegionLevel1, RegionLevel2, RegionLevel3 and "TestCases" in Dimensions.

In expressions, I have TestStatus which has values/data as "Open","Fixed","Closed" and "Reopen".

I have created the Pivot table and data is appearing as I expected.

Now I want to clour the data cells with different colors-"Red","Yellow","Green","Blue".

Where should I do it and How do I do it?

I have looked at Visual Cues but it needs numeric values where as I have text values in my data.

Please could you help me in setting background color for data cells based on values?

Thanks

Prasad

1 Solution

Accepted Solutions
Nicole-Smith

There should be a plus button to the left of your TestStatus expression.  Click that plus, then in Background Color you can write an expression to color your stuff, such as:

pick(match(TestStatus, 'Open', 'Fixed', 'Closed', 'Reopen'), red(), yellow(), green(), blue())

View solution in original post

8 Replies
Nicole-Smith

There should be a plus button to the left of your TestStatus expression.  Click that plus, then in Background Color you can write an expression to color your stuff, such as:

pick(match(TestStatus, 'Open', 'Fixed', 'Closed', 'Reopen'), red(), yellow(), green(), blue())

Anonymous
Not applicable
Author

Hi prasad,

Try below code:

In Background of an expression

If ( Status is = "Open",lightred())

If ( Status is = "Fixed",lightcyan())

If ( Status is = "Closed" ,lightgreen())

If ( Status is = "Reopen",lightblue())

Or try with nested if's

Not applicable
Author

Hi Prasad,

Expression--> +--->maje it - then--->Bgcolor---then in the def write like this

Use Pick(match(fieldname,'Open','Closed','Fixed'),rgb(255,255,255), rgb(110,210,120),Green()).

-------Use like. It  gives performance wise better than nested if.

i hope helps you.

Regards

Mahesh T

sanketkhunte
Creator II
Creator II

Hi Prasad,

Use following highlighted Background Color property to write an expression. You can write expression over there and you may also use RGB() function to exact color code match.

BG.PNG.png

Thanks

Sanket

Not applicable
Author

Thanks all very much for your quick responses.

Now I know where to make the change  "Expression > + > Background Color" and what to write in the "Definition" - Pick(Match...) & If options.

I tried both and it worked.

I also liked the 'light' colors & rgb options.

It would be nice to have a  readily available list of colors/ rgb combinations and how they look. Do you have any?

Not applicable
Author

Hi,

go for caption tab and u can get diffrent colors and rgb values find the attachemnet.

Not applicable
Author

Fantastic!. Thanks again.

Nicole-Smith