Search code examples
javascriptwebdatarocks

How to get Grand Total of a column using Webdatarocks and use it in charts


I am using Webdatarocks Pivot table. I get GrandTotal at the bottom of Grid, I want use this Grand Total in the Charts. I checked community but I am unable to find appropriate function which can provide me value of my GrandTotal.

I checked functions in Documentation like getAllMeasures(), getReport() etc. but none of them returns GrandTotal.

There is one way where I can calculate GrandTotal using Javascript function, but in my case GrandTotal will change soon I apply filters in Pivot table. Please advice how to get them in order to use them intermediately.


Solution

  • There isn't a specific API call you could use to retrieve the grand total.

    You could though use the update event handler to trigger your own grand total calculation every time a new filter is applied.

    EDIT: On second thought, you could actually use the getData() method for this – among everything else, it returns the grand total value. More on this here.