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: 
Prachi_SS
Contributor
Contributor

Color Formatting

Need to change color only after slash if positive number then it should change to green ,for -ve number change it to red color

e.g.

-5% / 13444

for -5% i.e before slash value no need to change color and after slash for 13444 need to show green color, if it is negative value it should show red color.

Labels (5)
4 Replies
anat
Master
Master

try using conditional color like

if (sum(sal)>0,green(),red())

Prachi_SS
Contributor
Contributor
Author

I have tried using this scenario but expression got applied completely not only after slash value. I am not getting expected results.

Thank you for your solution!

Aditya_Chitale
Specialist
Specialist

Try this :

if(subfield(FieldName,'/',-1) > 0 , green() , if(subfield(FieldName,'/',-1) <  0 , red()))

Regards,

Aditya

anat
Master
Master

assuming you are using single text object to show "-5% / 13444"  value,try to use 2 text objects and apply above condition for color.