Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
vivekraghu25
Contributor
Contributor

Background color pivot table based on column total

Hi all

I've been struggling with this and hoping I could get some help. I have a pivot table with a field called Spec in the Row. The column area has 2 fields, region and area. I have turned on the Show totals toggle for the region column and would like to have all background color based on that totals. 

As seen in the attached, I have turned on the "Show totals" toggle on the region column and can see that it is 1.46 for the first item in the row. I'd like the background color of the values in that row to be red if greater than 1.46 and green if lesser. And likewise, apply this for all rows.

Appreciate any help with this.

Labels (2)
3 Replies
Antoine04
Partner - Creator III
Partner - Creator III

Hello,

Is that what you want to do ?

Antoine04_0-1717771213745.png

If yes, here is the formula you need to write : 

If(ColumnNo()=0,Blue(),
    If(Avg(Marge)>Avg(Total <Mois> Marge),Green(),LightRed()))

Regards,

Antoine

vivekraghu25
Contributor
Contributor
Author

Almost. But not exactly. To give an example, If the values in the first row are less than 9,14 then green, else red. Similarly for all rows. 

Antoine04
Partner - Creator III
Partner - Creator III

So, like this ?

Antoine04_0-1718003328708.png

Or all the cells compared to 9.14 ?

Regards

Antoine