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

if source count is less than 2, highlight red

Hi,

Dimension: Place1

Expression: =Aggr(Count(DISTINCT(Source)),Place1)

I'm trying to use this equations in my chart, for the background part of my expression:

=if(Aggr(Count(DISTINCT(Source)< 2),Place1),RGB(255,66,66),Aggr(Count(DISTINCT(Source)),Place1))

I want the cells for 'Source' to have a red background when the count(Source) is less than 2.

The above equation won't work, everything is highlighted red.

how do I fix this?

1 Solution

Accepted Solutions
Anonymous
Not applicable

try this:

=IF(Count(<Total Destination1> Distinct Source)>2, RGB(255,66,66), Count(<Total Destination1> Distinct Source))


View solution in original post

2 Replies
Anonymous
Not applicable

try this:

=IF(Count(<Total Destination1> Distinct Source)>2, RGB(255,66,66), Count(<Total Destination1> Distinct Source))


sunny_talwar

Count(Source) and Count(DISTINCT Source) are two different things... Do you want just the count for each Destination1 or the DISTINCT count?

and I don't think you need to use Aggregate function if you only have Destination1 as your dimension:

Try this:

=If(Count(Source) < 2, Red(), Green()) //use DISTINCT if required