I have sheet Transactions with the main data, and sheet Report (Active) with the name of the person and into which the metrics that will be calculated from the Transaction main data will be fed. First step is to retrieve the data for that person (cell B6 in the Report) with another condition based on a different column.
var report = SpreadsheetApp.getActiveSpreadsheet();
var trsheet = report.getSheetByName("Transactions");
var areport = SpreadsheetApp.getActiveSheet();
var agent = areport.getRange('B6').getValue();
var trdata = trsheet.getDataRange().getValues();
var tdata = trdata.filter(function (row) {
return row[29] == agent && row[5] == 'Closed' ;
});
This produces no errors, but an empty array for tdata. How do I correctly add the second condition to the filter function?
Report!B6for data to be filtered and the expected results. - Rubén