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: 
Not applicable

Background colour in pivot table based on expression

Hi Guys,

I have this dummy data:

Name      Price

A               100

B               105

C               95

D               80

I want to do the following thing with it: I want every number in the Price column to have a background color code as follows:

100 should be green for being the first number in the column

105 should be green because it's in the firstNumber (100 in this case)*0.95 and firstNumber*1.05 range

95 should be green because it's in the firstNumber*0.95 and firstNumber*1.05 range

80 should be red because it's not in the range

This is a pivot table. Also, I've tried with if(Price<First/Top(Price)*1.05 and Price>First/Top(Price)*0.95, green(), red()) but didn't get the desired result. Any ideas?

Thanks,

Adrian

PS: I have the free version so I cannot open qvw files, so please try to explain your answer by writing, not attaching a file

0 Replies