Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Issue with background colour in straight table

Hi,

Can someone help me with the below mentioned issue.

Old Yield as =num([Prior Month End Lessor Yield],'##.000')
New Yield as =num([Month End Lessor Yield],'##.000')

And have given code for background colour as
=if((num([Prior Month End Lessor Yield],'##.000')) <> (num([Month End Lessor Yield],'##.000')),rgb(255,0,0),null())

But for the 1st, 5th, 12th even though [Prior Month End Lessor Yield] = [Month End Lessor Yield], still background colour is being displayed as red

Thank you in advance.

Reagrds,

Adi

6 Replies
sunny_talwar

Try this (assuming Old Yield and New Yield are your expression Labels):

=If([Old Yield] = [New Yield], RGB(255,0,0))

Quick Note: Old Yield and New Yield should turn Blue, if they are not turning blue and are red then you might have a column name in your database called Old Yield and New Yield in which case I recommend using Column() functions for both Old Yield and New Yield.

Assuming Old Yield is first expression and New Yield is the second expression you can use the following:

=If(Column(1) = Column(2), RGB(255,0,0))

Hope this helps.

Best,

Sunny

Not applicable
Author

Nope, It didn't work Sunny!!!

Anonymous
Not applicable
Author

Have you tried to floor both values and then compare them?

for example:

=If(floor([Old Yield],1,0.5) = floor([New Yield],1,0.5), RGB(255,0,0))

nico_ilog
Partner - Creator II
Partner - Creator II

Aditya,

which columns are Dimensions and which ones are Expressions?

Regards

nico_ilog
Partner - Creator II
Partner - Creator II

I have one recommendation:

Change this:

Old Yield as =num([Prior Month End Lessor Yield],'##.000')
New Yield as =num([Month End Lessor Yield],'##.000')

To this:

Old Yield as =[Prior Month End Lessor Yield]

New Yield as =[Month End Lessor Yield]


Then check the rest of the decimals, maybe they are actually different.


Thereafter,

Use the Number property of your chart to ammend the formatting

Capture.JPG

jonathandienst
Partner - Champion III
Partner - Champion III

Num() does not round the values off, it simply changes the display format (in fact it does nothing useful in your expression). The numbers highlighted in red are not equal, but the difference is in the part that is hidden by the display format. This should work:

=if(round([Prior Month End Lessor Yield], 0.001) <> round([Month End Lessor Yield], 0.001), rgb(255,0,0))

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein