# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Contributor II

## Color Coding Based on Calculation

Hello,

I'm trying to color code based on my expression:

So if my expression:  =Count({1}DISTINCT BarcodeI) - Count(DISTINCT{<Pass= {'YES'}, Barcode>} Barcode)  equals more tahn 0 I want it to be read. I've tried a few things but it's not working.

I tried:

if(sum(Count({1}DISTINCT BarcodeI)-Count(DISTINCT{<Pass= {'YES'}, Barcode>}) = '>0' , lightred, RGB(160,160,160)))

also

if(Count({1}DISTINCT BarcodeI)-Count(DISTINCT{<Pass= {'YES'}, Barcode>}) = '>0' , lightred, RGB(160,160,160))

I'm obviously doing something wrong since it's not working.

1 Solution

Accepted Solutions
MVP

## Re: Color Coding Based on Calculation

If(Count({1}DISTINCT BarcodeI) - Count(DISTINCT{<Pass= {'YES'}, Barcode>} Barcode) > 0, LightRed(), RGB(160,160,160))

2 Replies
MVP

## Re: Color Coding Based on Calculation

If(Count({1}DISTINCT BarcodeI) - Count(DISTINCT{<Pass= {'YES'}, Barcode>} Barcode) > 0, LightRed(), RGB(160,160,160))

Contributor II

## Re: Color Coding Based on Calculation

Thank you, I see what I missed