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

two if statements to highlight cell red

Hi,

I have this function for my straight table:

=if(Count(DISTINCT(Source))< 3 and Source <>'Mapping Table',RGB(255,66,66),Count(DISTINCT(Source)))

What I want to do is when count(distinct) of Source is less than 3, and when source = 'mapping table', then I want the cell to be highlighted red.

But it won't work.

How can I set this up correctly?

5 Replies
sunny_talwar

Would you be able to share a sample of what you are trying to do? Is this a Background color expression we are looking at?

sinanozdemir
Specialist III
Specialist III

Are you putting this expression into Background Color view?

Capture.PNG

eduardo_sommer
Partner - Specialist
Partner - Specialist

Hi,

Try the following expression on the Background color property of your expression:

=if(Count(DISTINCT(Source))< 3 and Source <>'Mapping Table',RGB(255,66,66))


Eduardo

Mark_Little
Luminary
Luminary

Hi,

I think what you want is something like

= Count({<Source -={'Mapping Table'}>}DISTINCT(Source)) as your expression and like mentioned above

Have the expression for the background colour

IF(Count({<Source -={'Mapping Table'}>}DISTINCT(Source)) < 3, RGB(255,66,66))


Mark

MK_QSL
MVP
MVP

=if(Count(DISTINCT({<Source -= {'Mapping Table'} >}Source))< 3 ,RGB(255,66,66))