Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
stjernvd
Contributor

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
balrajahlawat
Esteemed Contributor

Re: if source count is less than 2, highlight red

try this:

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


2 Replies
balrajahlawat
Esteemed Contributor

Re: if source count is less than 2, highlight red

try this:

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


Re: if source count is less than 2, highlight red

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