# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
CUSTOMERS ONLY: Now accepting customer applications for the 2023 Luminary Program: SUBMIT NOW
cancel
Showing results for
Did you mean:
Contributor III

## Problem with comparison two values

Hi everyone, I'm trying to colour the cells of a colunm when its value differs from the one in another colunm. Something like this

The expression that rules this  in the property of Backgroun Color is:

```if([New PVP]<>[Old PVP], RGB(192,192,192), RGB(255,255,255))
```

But It doesn`t work always as you can see:

Does anybody have a clue?

1 Solution

Accepted Solutions
Champion

Try like below,

if(Round([New PVP] ,0.01)<> Round([Old PVP] ,0.01), RGB(192,192,192), RGB(255,255,255))

9 Replies
MVP

What are these columns? New PVP and Old PVP? Just looking at the partial image doesn't really help. Would you be able to give more details, and share a sample if possible?

Preparing examples for Upload - Reduction and Data Scrambling

[New PVP] and [Old PVP] are expression label or field?

try to put the actual expression in background color

if(ExpressionForNewPVP <> ExpressionForOldPVP,RGB(192,192,192), RGB(255,255,255))

Contributor III
Author

They are Two prices

New PVP (New Price) is defined bay the following expression:

```if(Match(Right(num([PVP Definitivo],'#.##0,00;-#.##0,00'),1),1,2,3,4,5)<>0 , Ceil([PVP Definitivo],0.05),
if(Match(Right(num([PVP Definitivo],'#.##0,00;-#.##0,00'),1),6,7,8,9)<>0, Ceil([PVP Definitivo],0.05,-0.01),
Round(num([PVP Definitivo],'#.##0,00;-#.##0,00'),0.01)))
```

And Old PVP (Old Price) by this one:

```num(PriceToCompare.PVP,'#.##0,00;-#.##0,00')
```

MVP

Why won't the labels work Kush?

MVP

Would it be possible to share a sample? I am still not sure I understand what you are doing.

Contributor III
Author

It doesn't work either. [New PVP] and [Old PVP] are expression labels.

Champion

Try like below,

if(Round([New PVP] ,0.01)<> Round([Old PVP] ,0.01), RGB(192,192,192), RGB(255,255,255))

Contributor III
Author

Yeah!! It works!! I don't know why but it does. Thank you all for your time.

Champion

Actually, your both column values are not same, As you have used ceil and round functions in your expression, it gives the illusion. Your [New PVP] column values might be 1.1912 and [Old PVP] can be 1.19. So, We can use round function in the column labels to compare the values.

Community Browser