Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
pandreozzi
Creator
Creator

Background Color on Selected Cell in a Table Box

Sorry for the simple question here but I cannot seem to find the answer. I want to have the background color change on a selected cell and have that cascade to other sheets with associated records. Can anyone assist.

Thanks, Paul

13 Replies
tajmohamed30
Creator III
Creator III

Hi Pauk,

you can switch to show grid by ctrl+G from sheet and now right click on the exact cell value inside table which you want to format and select custom format and now you can format the particular cell to change color, bold, underline,etc

Regards

Taj Mohamed

pandreozzi
Creator
Creator
Author

Taj. thanks for the quick reply however this is not what I need. The current cell background color is white. This is a 1 x 4 table box so all 4 boxed need to change to green or another color when I select a customer in the table box. I did not see the option to change the background color when selected only the boarder color unless I am missing something.

tajmohamed30
Creator III
Creator III

could you please share screenshot and explain so it would be easy for us to understand

pandreozzi
Creator
Creator
Author

Hi Taj. see insert below. I added text to the attachment also. I need to key on the active and inactive text in the screen shot so I am leaning toward using a variable that triggers on the text in order to change the background color.qlikcolor.jpg

tajmohamed30
Creator III
Creator III

Hi Paul,

Created something like you have requested, have a look at it.

Hope you will find it useful.

Regards

Taj Mohamed

sergio0592
Specialist III
Specialist III

You can't customize background color in table box with formula. So why you don't use a straight chart? In my attached file, when you clik in a country inside the chart (or select in a list box) you have green cell if you select Russia and red cell if you select UK.

Regards

tajmohamed30
Creator III
Creator III

I can select both colors at a time however showed only an example of the concept

pandreozzi
Creator
Creator
Author

Taj. although this is helpful I only see you changing the background in the chart off the table box and not the background color in the table box. I was able to change one color on the table box with this.

Ctrl - G to enable custom format cell

=if(SITE_STATUS = 'Active', Green(), White())

however when I add a condition for 'Inactive' it will not work correctly.
=if(SITE_STATUS = 'Active', Green(),White()) or if(SITE_STATUS = 'Inactive',Red(),White())

This only allows for 'Active' condition so I am doing something wrong although the expression is a valid expression.



Paul


sergio0592
Specialist III
Specialist III

I can't achieve what you expect but maybe i'am on the right way:

1. Create variable V_test_selec :

if(substringcount(concat(DISTINCT SITE_STATUS),'ActiveInactive')=1 and GetSelectedCount(SITE_STATUS)>1,3,

if(substringcount(concat(DISTINCTSITE_STATUS),'Active')=1,2,

if(substringcount(concat(DISTINCT SITE_STATUS),'Inactive')=1,1

)))

2. Add ValueList(1,2) as calculated dimension and hide it in presentation tab

3.Use this variable in background color formula:

if(GetSelectedCount(SITE_STATUS)=0,white(),

if(V_test_selec=1,LightGreen(),if(V_test_selec=2,LightRed(),if(V_test_selec=3,if(ValueList(1,2)=1,LightGreen(),LightRed()
)))))

But, I don't manage the case where user select Active, Inactive and at least one more value and value list in the chart duplicates lines. But experts will probably have a reliable solution