cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional Color Formatting by Dimension / Row Combination in Pivot Table

mmalhame
8 - Cloud Apps
8 - Cloud Apps

I would like to conditionally format a pivot table depending on the combination of 2 dimensions in the view.

For example, in the screenshot below, I would like to color 'Bindable Ready to Quote' and 'cold' or 'open' green, and 'Bindable Ready to Quote' and 'pending' or 'solved' as red. Then I would like to color 'Complete Navigator' and 'cold' as green, and 'Completed Navigator' and 'open', 'pending', or 'solved' as red. 

Is there a way to code in specific combinations of dimensions as colors in the view?

 

mmalhame_0-1732555810177.png

 

4 REPLIES 4

DRay
Community Team Leader
Community Team Leader

Hi @mmalhame,

Thank you for reaching out. Can you take a look at this post and let us know if it helps?

https://community.sisense.com/t5/knowledge-base/applying-conditional-formatting-based-on-another-mea...

Thank you.

David Raynor (DRay)

mmalhame
8 - Cloud Apps
8 - Cloud Apps

Hi DRay - no, the post you linked does not apply because it is written about an indicator. I need to conditionally format a pivot table. 

HamzaJ
12 - Data Integration
12 - Data Integration

Hey @mmalhame ,

There probably is a javascript to do this, however I am not a javascript expert so my suggestion would be to use HTML.

Pivot tables allow HTML, so you could add to that field (or create a new one ) in the elasticube something like;

case

when group = 'Bindable Ready to Quote' and status in ('open','cold') then concat(concat( '<font size="6" face="verdana" color="green">',status),'</font>')

etc

Hamza

mmalhame
8 - Cloud Apps
8 - Cloud Apps

Thanks Hamza. Can you help me understand where I would input the HTML code? Is it using the 'Edit Script' button within the widget? 

Also, I would like the background 'highlight' color within the cell to be red or green, not the font itself. How would that change the HTML code you shared?