Skip to main content

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 
Search instead for 
Did you mean: 
pitutiti
Contributor III
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
tamilarasu
Champion
Champion

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
sunny_talwar

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

Kushal_Chawda

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

pitutiti
Contributor III
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')

Thanks for your time

sunny_talwar

Why won't the labels work Kush?

sunny_talwar

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

pitutiti
Contributor III
Contributor III
Author

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

tamilarasu
Champion
Champion

Try like below,

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

pitutiti
Contributor III
Contributor III
Author

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

tamilarasu
Champion
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.