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: 
sonu8072
Contributor III
Contributor III

Value dependent Expression font color formula

Hi Friends!

I have been struggling with this code for a long time now, so thought I should reach out to your guys out there. What I am trying to achieve is in a Pivot (cross) table there is district wise & day wise % Online Sales and the following color code is to be applied on the same -

1. If value in less than 25%, font color must be Red.

2. If value in more than 95%, font color must be Green.

3. Anything in between the above 2 limits must be Red if lesser than the previous day or else Green if higher than the previous day.


Code I could write is as follows, but it is throwing an error -


IF((SUM(IF(Class2='WEB',Quantity))/SUM(Quantity))<25%,lightred(128),IF((SUM(IF(Class2='WEB',Quantity))/SUM(Quantity))>=before(SUM(IF(Class2='WEB',Quantity))/SUM(Quantity)),green(128),lightred(128)))


Also enclosed the result. Help is appreciated in advance!

2 Replies
YoussefBelloum
Champion
Champion

Hi,

I think you'll have to attach some rows from your data. or at least create the same table structure.

Anonymous
Not applicable

Hi ,


After seen that image, i feel, the font size is same , but for the totals font size is BOLD. The color of font is based on condition wise.

To get that you have to write a if condition in expression level ,after expanding the + sign.

Attached the image below for reference. In your case you have to write the IF condition in Text colorCapture.PNG