Forum Discussion

cartercjb's avatar
02-19-2022

APPLY CONDITIONAL FORMAT TO ENTIRE ROW

Is there a way to apply conditional formatting to an entire row, based on the conditions of 1 value? 

I'm pretty sure I could copy the formula to all other values, but that would be annoying with hows many we have in the pivot. PLUS it would not cover any rows. 

 

 

5 Replies

Replies have been turned off for this discussion
  • harikm007's avatar
    harikm007
    Data Warehouse

    cartercjb ,

    If you are using Pivot2, please try this script (Reference)

    widget.on('ready', function(se, ev) {
    	
    	panelName = 'Value 1' //Update your panel name from which color needs to spread to entire row
    	
    	var colIndex = -1
    	$('pivot2 .pivot-scroller table tbody tr').each(function(index, trElement){ 
    		if(index == 0)
    		{
    			$(trElement).find('td .table-grid__content .table-grid__content__inner').each(function(tdIndex, tdElement){
    				if ($(tdElement).text() == panelName){
    					colIndex = tdIndex
    				}
    			})
    		}
    		else{
    			if(colIndex >= 0){
    				bgColor = $(trElement).find('.table-grid__cell--col-' + colIndex).css('backgroundColor')
    				$(trElement).find('td').each(function(tdIndex, tdElement){
    					 $(tdElement).css('backgroundColor', bgColor)
    				})
    
    				$('pivot2 .table-grid--rows table tbody tr').each(function(rowIndex, rowElement){
    					if(rowIndex > 0 && index == rowIndex){
    						$(rowElement).find('td').css('backgroundColor', bgColor)
    					}
    				})
    			}
    		}
    
    	})
    })
    

    -Hari

     

    • cartercjb's avatar
      cartercjb
      ETL

      Thanks, Hari. 

      I am using the default Pivot widget.. is that Pivot 2 or is that a blox widget? If it is a blox widget, can you please reference the default article to create a pivot 2 widget? Thanks!

      -Carter

       

      • harikm007's avatar
        harikm007
        Data Warehouse

        cartercjb , 

        Pivot2 is also displayed as normal Pivot widget. My understanding is Pivot2 is available in Sisense Linux version. Not sure if it is available for windows.

        -Thanks