Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Changing background color based on text

Hi All,

New to Qlik Sense but been around Qlikview for 8 years. I am trying to change the background color of an individual cell based on a text value.

I have a column named statCol  which could be 1 on the following possibilities : 'R', 'G' or 'Y'

In the Background Color Expression I have entered :

If(statCol= 'R', red(),

    If(statCol = 'G', green(),

          If(statCol = 'Y', yellow(),lightgray())))

The background color based on the first rows value of statCol is repeated for every row instead of being painted based on the expression for each individual row/col . Is this normal Qlik Sense functionality?

I have searched but can't find out if what I am trying to do is not possible or is my expression  poorly written?

Kind Regards,

-bill

2 Replies
ogster1974
Partner - Master II
Partner - Master II

It should work Bill

I just applied to one of my tabes and it worked as expected

Inserted in Background Exprenssion

If(NOC = 'Great Britain (GBR)', red(),

    If(NOC ='United States (USA)', green(),

          If(NOC = 'China (CHN)', yellow(),lightgray())))

And got this...

As long as your column is a Dimension rather than measure it should work.

Regards

Andy

harika18
Contributor III
Contributor III

Can we hide the gold column(numeric values) in background and just show the color?