Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
New 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

Captura1.PNG

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:

Captura2.PNG

Does anybody have a clue?

Thanks in advance.

1 Solution

Accepted Solutions
Highlighted

Re: Problem with comparison two values

Try like below,

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

View solution in original post

9 Replies
Highlighted

Re: Problem with comparison two values

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

Highlighted

Re: Problem with comparison two values

[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))

Highlighted
New Contributor III

Re: Problem with comparison two values

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')

Thanks for your time

Highlighted

Re: Problem with comparison two values

Why won't the labels work Kush?

Highlighted

Re: Problem with comparison two values

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

Highlighted
New Contributor III

Re: Problem with comparison two values

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

Highlighted

Re: Problem with comparison two values

Try like below,

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

View solution in original post

Highlighted
New Contributor III

Re: Problem with comparison two values

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

Highlighted

Re: Problem with comparison two values

     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.