Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
hammermill21
Creator III
Creator III

Background Color Expression - Qlik Sense

Hello, everyone-

I am trying to change the background color to a column in a table, I have it working for two colors using this expression:

Count(Distinct [Inspection Bar Code])/$(fInventoryCount]<.50, RED(), Yellow()

But I want to add also if it's over .70 to be blue and if it = 0 to be black. Yet everytime i try to add to the expression it stops working.

Any ideas?

Thanks!

1 Solution

Accepted Solutions
OmarBenSalem

Try this:

If(Count(Distinct [Inspection Bar Code])/$(fInventoryCount) = 0, Black(),

If(Count(Distinct [Inspection Bar Code])/$(fInventoryCount)<.50, RED(),

If(Count(Distinct [Inspection Bar Code])/$(fInventoryCount)< .70, Yellow(), Blue())))


See the attached app

View solution in original post

11 Replies
OmarBenSalem

can you share your QVF file containing this table?

Thanks

sunny_talwar

May be you missed the if statement?

If(Count(Distinct [Inspection Bar Code])/$(fInventoryCount]<.50, RED(), Yellow())

hammermill21
Creator III
Creator III
Author

I have the "If" in it, sorry I didn't include that in my question!

hammermill21
Creator III
Creator III
Author

I just attached it to my original post. Thanks!

sunny_talwar

Then try this

If(Count(Distinct [Inspection Bar Code])/$(fInventoryCount] = 0, Black(),

If(Count(Distinct [Inspection Bar Code])/$(fInventoryCount] <.50, RED(),

If(Count(Distinct [Inspection Bar Code])/$(fInventoryCount] < .70, Yellow(), Blue())))

hammermill21
Creator III
Creator III
Author

That's what I thought it would be and it's not working. So strange!

OmarBenSalem

Try this:

If(Count(Distinct [Inspection Bar Code])/$(fInventoryCount) = 0, Black(),

If(Count(Distinct [Inspection Bar Code])/$(fInventoryCount)<.50, RED(),

If(Count(Distinct [Inspection Bar Code])/$(fInventoryCount)< .70, Yellow(), Blue())))


See the attached app

OmarBenSalem

It's working, It's just that sunny miss wrote it

If(Count(Distinct [Inspection Bar Code])/$(fInventoryCount] = 0, Black(),

If(Count(Distinct [Inspection Bar Code])/$(fInventoryCount] <.50, RED(),

If(Count(Distinct [Inspection Bar Code])/$(fInventoryCount] < .70, Yellow(), Blue())))

$(fInventoryCount) not $(fInventoryCount]

hammermill21
Creator III
Creator III
Author

Ah! What a foolish mistake!! THANK YOU!!!!!