Showing results for 
Search instead for 
Did you mean: 

Financial Formatting for Pivot Tables on Linux

Sisense Team Member
Sisense Team Member

Financial reports usually have specific styling requirements where negative numbers are shown in parentheses as opposed to having a leading minus sign. They are also usually written in red.  

The script below formats all the negative numbers in pivot tables exactly as the requirements above. Feel free to modify it if you have different formatting requirements.



// Format negative numbers
widget.transformPivot({ type: ['value'] }, function(metadata, cell) {
    if(cell.value >= 0 || !cell.value) {
        cell.content = cell.value;
		cell.contentType = 'html';

    } else
	  	cell.content ='(' + (-1*cell.value).toString() + ')'; = 'red';
        cell.contentType = 'html'; 


Tri Anthony Situmorang

9 - Travel Pro
9 - Travel Pro


8 - Cloud Apps
8 - Cloud Apps

Thanks for this @TriAnthony 

We also created a great Expandable Pivot plugin which is perfect for financial statements like P&L, Income statements and Balance sheets, and it too of course takes care of negative financial formatting,



Voice of Customer
Impact Business Intelligence (BI) and Analytics Market Research

Click Here & Complete Dresner's Wisdom of Crowds® Market Study Survey Today!

Community Toolbox

Recommended quick links to assist you in optimizing your community experience:

Need additional support?:

Community Support Request

Don't miss out:

Earn a BETA Launch Challenge Badge!