Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Sheets Pivot Table Not Updating

I have a google app script which submits info to an organized sheet and would like to create a pivot table with the all information in the sheet. I can do this, but whenever I submit a new row of data to the sheet, it is not automatically included in the pivot table. I have to manually change the range of the pivot table every time I submit a new row of data. Is there any way I can make the sheet/pivot table automatically include the new row of data?

like image 539
Ben Avatar asked Jun 01 '15 13:06

Ben


People also ask

Why is my pivot table not updating with new data?

Refresh data automatically when opening the workbook Click anywhere in the PivotTable to show the PivotTable Tools on the ribbon. Click Analyze > Options. On the Data tab, check the Refresh data when opening the file box.

Why is my pivot table not showing all data Google Sheets?

1. Right-click the PivotTable and select PivotTable Options… 2. Check Show items with no data on rows and Show items with no data on columns.

Why is my pivot table not updating Google Sheets?

In Google Sheets, if your pivot table has filters, your data won't be updated when you change the original data values. You'll need to remove the filters in your pivot table by clicking the cross symbol beside all the fields below the Filters option within the Pivot table editor.


2 Answers

I worked around this issue by only specifying the column range.

For example, if you have row data in columns A to F, set the range of the pivot table to SHEET!A:F

If you add rows now, the new data in those columns will be added to the pivot table.

like image 161
merlot Avatar answered Oct 17 '22 08:10

merlot


There is a way. I did exactly that 3 years ago on Sheets.

If you are submitting the new rows using Google Forms, then there is no way.

If you try to programmatically update the range, there is no way either because named ranges need to be deleted then re-added, causing #REF on the pivot.

Now for the good part: If you are adding the new row with a script, do not append it to the end. Instead, keep a fake row at the end (with zero values so pivot is not affected) and insert the new row just before it. Your range (named or not) will update.

Even for the Google Forms case, you might get it to work by pre-adding all blank rows to the response sheet and make the named range include the blank ones too.

like image 23
Zig Mandel Avatar answered Oct 17 '22 09:10

Zig Mandel