Sai Ram
Sai Ram

Reputation: 53

Query Range in a google sheet dynamically

I have a chart developed from google app script that references a spreadsheet.

My Data source looks like this

enter image description here

It has blank cells in between representing the holiday period when no recording is done. The source sheet grows daily by 1 row.

Currently my range query is

var range = sheet.getRange(firstrow, 1, sheet.getLastRow() - firstrow + 1, 3);

where the Lastrow is the last row of the google sheet and not the last row of the column data.

is there a way to create a iteration where the range gets dynamically changed based on the last row of of the column Data instead of the actual last row itself.

The result of my current range query gives me an output which looks like this. which adds a 0 to all the non updated rows under my data column

enter image description here

By only obtaining the range based on last row of the column Data, my chart wont have inevitable 0 until last row of the table. Is this possible.

I am just learning to use google app script. Any advice is much appreciated. TIA.

Upvotes: 0

Views: 548

Answers (0)

Related Questions