It would be nice if there was a query that could do this when the Sheet is first read, but as far as I know there is not. One solution is to download all the data then work on the datatable before you display it. The methods that can be used are at https://developers.google.com/chart/interactive/docs/reference#methods
One method that can be used is to find the number of rows in the datatable using .getNumberOfRows(), then a little math and use .removeRows(rowIndex, numberOfRows) The code then becomes: var dataTable = response.getDataTable(); num = dataTable.getNumberOfRows() dataTable.removeRows(0, num - 30) I have a Google Sheet that contains a little under 4,000 rows, and used this method to just show the last 30. An example file is at http://brisray.com/test/google-dave.htm to show you it working. Ray -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-visualization-api. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/4b878223-a902-45f2-adc8-bc74ed62710b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
