Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ronman10
Creator
Creator

Text Color Based on Expression for Comparison

Hi Guys,

I have a straight table which contains 2 columns, Avg. Selling Price (ASP) for 2018 and ASP for 2017, Customer wise. I want a comparison between these 2 columns in such a way that if value in ASP 18 column  is greater than the corresponding value in ASP 17 column, the text in ASP 18 should appear in green and red if lower. How can this be achieved? 

Formula I used for ASP calculation is Value 18/Volume18. Please advice.

Thanks,

Rony

16 Replies
ronman10
Creator
Creator
Author

If((Sum([USD 18])/Sum([Vol 18])>(Sum([USD 17])/Sum([Vol 17]), 'Green',

If((Sum([USD 18])/Sum([Vol 18])<(Sum([INR 17])/Sum([Vol 17]), 'Red'

jaumecf23
Creator III
Creator III

This is not correct. Try this:

=if(Sum([USD 18])/Sum([Vol 18])>Sum([USD 17])/Sum([Vol 17]), green(),red())

ronman10
Creator
Creator
Author

This too did not work. I am adding this expression to the cell text color space. I don't understand why the expression did not work.

ronman10
Creator
Creator
Author

Hi Jaume,

The above expression worked for "Cell background color" but not for "cell text color." However, this will work for now. Thanks for your help.

Rony

ronman10
Creator
Creator
Author

Hi Jaume,

I am working with a Vizlib table (extension) and they have options to change cell background color as well as cell text color. Your expression works for cell background color but not for cell text color. It should work for both, right?


Regards,

Rony

jaumecf23
Creator III
Creator III

Yes, it should work for both.

ronman10
Creator
Creator
Author

ok. thanks