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

Change Backround color for each row

I am creating a flat table which has column name 'Status' it has values like 0, 1 and 2.

I want that which row has value 0 should be red, 1 should be green ,and 2 should black.

I am writing like this in Background color expression-

=if(Status='0',Red()) OR if(Status='1',Green()) OR if(Status='2',Black())

But this is not working it make strange color rather than showing red row which has 0 value, and green row which has value=1 ,and black for value=2;

I am new here, pls. help me asap.

Thanks!

1 Solution

Accepted Solutions
Not applicable
Author

I think your if conditions ar not correct, they should be

=if(Status=0, Red(),if(Status=1, Green(), Black())

the if statement syntax is:

if(Condition,then,else)

Hope this helps

View solution in original post

3 Replies
Not applicable
Author

I think your if conditions ar not correct, they should be

=if(Status=0, Red(),if(Status=1, Green(), Black())

the if statement syntax is:

if(Condition,then,else)

Hope this helps

Not applicable
Author

Hi, it's sound like you need to use RGB function. And make just one if function.

Try to use the code in text color
















if(Status='0',RGB(300,0,0),if(Status='1',RGB(0,400,0),black()))




I try on my QV file and it's work.

Note: I use this code in pivot table.

Hope this will help Smile

Not applicable
Author

Thanks! Mubse and Tatarjar, Your Answers helped me to resolve this! Really great help! 🙂

Best Regards,

Yogesh