title: Sheets Apps Script filter multiple columns independently of each other
body: <p>I have a to do list sheet with a "done" column and a "note type" column and I am attempting to filter each of them independently using apps script.</p>
  
  <p>For example: I want to apply a filter to see only the completed notes of a specific type, OR I want to see only the outstanding notes of a specific type.</p>
  
  <p>The code I have is working, but will not apply both filters at the same time. Running the second filter resets the first.</p>
  
  <pre><code>function hideDone() {
    if( sheet.getSheetName() == sheetName ) {   
      var lastRow = sheet.getLastRow();
      if(sheet.getRange(1, doneCol,lastRow).getFilter() != null) {
        sheet.getRange(1, doneCol,lastRow).getFilter().remove();
      }
      var criteria = SpreadsheetApp.newFilterCriteria().whenTextEqualTo("FALSE").build();
      sheet.getDataRange().createFilter().setColumnFilterCriteria(doneCol, criteria);
    }
  }
  function onlyCue() {
    if( sheet.getSheetName() == sheetName ) {   
      var lastRow = sheet.getLastRow();
      if(sheet.getRange(1, noteTypeCol,lastRow).getFilter() != null) {
        sheet.getRange(1, noteTypeCol,lastRow).getFilter().remove();
      }
      var criteria = SpreadsheetApp.newFilterCriteria().whenTextEqualTo("CUE").build();
      sheet.getDataRange().createFilter().setColumnFilterCriteria(noteTypeCol, criteria);
    }
  }
  </code></pre>
  
  <p>Thank you for the help.</p>