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: 
Arun_141
Contributor III
Contributor III

Conditional background color in pivot table

Hello Experts,

I have one requirement where I want to show background color of one field cells  based on background color of other field cells. In the below image, I want to assign background color for the Country cells corresponding to each week based on City color i.e.  for  cell corresponding to week 1 for country X  should show red color , for week 2 it should be green, for week 3 both red and green is present then it should show red(if any city has red color then corresponding Country cell will become red), for week 4 it should show green. Similarly for Country Y. 

City color condition - if Sales>50 then green else red

pic1.JPG

Sample Data 

Country City Week Sales
X A 1 50
X A 2 60
X A 3 60
X A 4 70
X B 3 40
X B 4 80
X C 3 56
X C 4 74
Y D 3 43
Y D 4 67
Y E 3 56
Y E 4 47

Labels (1)
2 Replies
brunobertels
Master
Master

Hi Kumar 

unfortunately here is the best i have been able to achieve 

brunobertels_0-1604589598770.png

 

I used this formula 

if(min(aggr(sum(Sales), City,Week))<50,red(),green())

(country will be red if one of the City is below 50 , City will be red if it is under 50 , but not able to put all the cities in red if one of them is under 50 ) 

And some else without your expected result but i missed something. 

I hope the community will able to help 

 

regards 

Arun_141
Contributor III
Contributor III
Author

@brunobertels  thanks for the response