I have a large google sheet with 30275 rows and 133 columns in a google sheet. I want to filter the data and copy column AZ to another spreadsheet.
Link to spreadsheet: https://docs.google.com/spreadsheets/d/1aiuHIYzlCM7zO_5oZ0aOCKDwPo06syXhWvhQMKgJE2I/edit?usp=sharing
I have been trying to follow this link
I am not that familiar with javascript and the code is designed to exclude items from filter rather than including items on filter. I have 500+ items to exclude so need to work out something that will be efficient in filtering large dataset in short time before execution limit is reached.
Here is my code so far. Any help to get this working would be appreciated.
NOTE: Filter/ Query with importrange formulas dont work due to the large volume of data. So I need an efficient script to filter large dataset and move them to another sheet before execution time limit.
function filtered() { var ss = SpreadsheetApp.openById('1u9z_8J-tvTZaW4adO6kCk7bkWeB0pwPcZQdjBazpExI'); var sheet = ss.getSheetByName('Sheet1'); var destsheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('JockeyList'); var demosheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Betting data - Demo'); var jockey = demosheet.getRange('L14').getValues(); // Get full (non-filtered) data var values = sheet.getRange('A:EC').getValues(); // Apply filter criteria here //Logger.log(jockey); var hiddenValues = jockey; values = values.filter(function(v) { return hiddenValues.indexOf(v[51]) == 1; }); Logger.log(values.length); // Set filtered data on the target sheet destsheet.getRange(10, 5, values.length, 2).setValues(values); }
没有评论:
发表评论