Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
hammermill21
Creator III
Creator III

Changing background color based on two different words

Hello,

I have a table that when there is a "Y" under "entrapment" I want the cells to turn yellow and if there is a "Y' under Vandalism I want the cell to turn red.  I know if I do this:


if(Entrapment='', white(),    yellow())


It will work but how do I add the Vandalism part to this expression?


Thank you!

1 Solution

Accepted Solutions
sunny_talwar

May be this

If(Entrapment = 'Y', Yellow(),

     If(Vandalism = 'Y', Red(), White()))

View solution in original post

6 Replies
sunny_talwar

May be this

If(Entrapment = 'Y', Yellow(),

     If(Vandalism = 'Y', Red(), White()))

Anil_Babu_Samineni

Perhaps this?

If(Entrapment='', White(), If(Vandalism='Y', Red(), Yellow()))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
hammermill21
Creator III
Creator III
Author

Thank you Sunny,

I see what I did wrong when i tried that.

Thank you

sunny_talwar

What was it, if you don't mind sharing that

hammermill21
Creator III
Creator III
Author

I had it set  like this:

if(Entrapment='', white(),    yellow())

     if(Vandalism='', red(), white()))


I needed to remove the first "White()", an oversight on my part.

sunny_talwar

Make sense, thanks for sharing