Using getData to return all data without expanding the UI

Answered
Christopher Phillips asked on May 28, 2019

Is there anyway using the getData API to return all pivoted data including the collapsed data?
 
We want to have access to all the raw data without having to expand all collapsed data.

4 answers

Public
Christopher Phillips May 28, 2019

If at all possible an optional parameter ex: getData(allData: true) would be great!

Public
Vera Didenko Flexmonster May 30, 2019

Hello, Christopher,
 
Thank you for writing to us.
 
We would like to confirm that the getData() API call can be used to return all pivoted data including the collapsed data.
You can define a separate slice (which will not be shown on the grid) and pass it to getData:
 

function getAllDataFromGrid(){

// get the current report
var report = pivot.getReport();

// get the currently displayed slice and set expands and drills
var slice = report.slice;
slice.expands = {expandAll: true};
slice.drills = {drillAll: true};


pivot.getData({slice:slice}, function(data){
console.log(data)
});
}

Here is a JSFiddle for illustration.
 
Please let us know if this works for you.
 
Best Regards,
Vera

Public
Christopher Phillips June 7, 2019

Thanks for the response Vera that does work for us but I think we might be pushing the limits just a little bit.  I used to your fiddle and connected it to a local CSV with 50,000 rows and 12 columns. Through some testing in the fiddle I found that getData breaks if you build a pivot that has more than 4 columns and 4 rows. If you do specify 4 columns and 4 rows getData returns an array > 5,000,000 but if you specify more rows or cols the browser crashes. We were wondering if there was a way for getData to fail more gracefully if the data set is to large. 
 
I’ve attached the test dataset.

Public
Vera Didenko Flexmonster 6 days ago

Hello, Christopher,
 
Thank you for bringing this to our attention and for providing test data.
 
Our team will look into this in more detail and we will notify you about the result of our research with the ETA 15th of July.
 
Please let us know if you have further questions.
 
Best Regards,
Vera

Please login or Register to Submit Answer