Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
jlampard40
Contributor III
Contributor III

Background Colour if value within % of another value

I have a straight table, where I'm calculating values based on today's data, against historical data.  If today's value is equal to or greater than the maximum value I have given it a red background - otherwise it's a green colour (see attachment of table):

if(column(4)>=column(2),LightRed(),LightGreen())

What I would also like to colour code, is if today's value is within 2% of the max value - identify with orange colour.

Can you advise if this is possible?  If so, how do I write this as an expression to change background colour?

Thanks guys.

Rgds

Labels (4)
4 Replies
Kushal_Chawda

what is the expression for max value?

jlampard40
Contributor III
Contributor III
Author

=max( aggr( count([WBR_Event_Key]), [WBR_Stat_Date],[WBR_Examination] ))

Kushal_Chawda

you can write the expression in background color like below

if(column(4) / column(2) <=0.02,LightRed(),LightGreen())

Brett_Bleess
Former Employee
Former Employee

If Kush's last response got things working, please do not forget to return to your post and on his post use the Accept as Solution button to mark that post as the correct solution.  This also gives him credit for the assistance and lets other Members know it worked.  We would appreciate it if you could complete the thread, or let us know that was the solution, and we can mark it for you in that case too.  If you are still working on things, please leave an update on what you still need.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.