cancel
Showing results for 
Search instead for 
Did you mean: 

Financial Formatting for Pivot Tables on Linux

TriAnthony
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() + ')';
  		cell.style.color = 'red';
        cell.contentType = 'html'; 
    }
});

 

Tri Anthony Situmorang
3 REPLIES 3

szimmermann
9 - Travel Pro
9 - Travel Pro

Thanks!!!

Ido_QBeeQ
9 - Travel Pro
9 - Travel Pro

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,

Ido

 

Paldi
9 - Travel Pro
9 - Travel Pro

his is very helpful indeed. 

There is a better FREE alternative, especially for those who don't wish to plot widget scripts in every widget they make: 

In this link (an old post that we have published a while ago on the old community website) you can download a FREE plugin that allows you to add Financial Formatting capabilities to all your dashboards and allows you to turn it on\off from the UI instead of the script...

Other than that, if we're talking about useful marketplace plugins around the topic that we have developed and I would advise to know about: 

Pivot2 UI Enhancements

 A powerful plugin that adds great capabilities to your pivot tables - no widget script is required

* Financial Formatting is one of them 

 

Widget Script Manager

An amazing plugin that allows you to manage all your widget scripts in one centralized place and choose where and how they would be triggered by using a smart triggering engine. 

* It also comes bundled with 50+ (supported) common script samples to expedite your scripting work and Financial formatting over Pivots (and other widget types) is one of them

 

Premium Expandable Pivot Table

A premium pivot plugin that acts like a "pivot on steroids", it is similar in nature to QBQ's plugin but much more advanced with an enormous amount of features. 

* The plugin has a feature that allows you to apply  "Custom Data Formats" on the measurements and Financial Formatting is one of the Data Formats that you can use (you can also easily develop and use your own custom data formats or make adjustments to existing ones. 

 

 

Feel free to reach out of you have further questions, we're always happy to help (: 

ravid@paldi.solutions 

Paldi Solutions - Number #1 Sisense Plugins Developer