Equivalent of “=Query(ImportRange(” in Google Apps

2019-09-08 04:15发布

问题:

For example in the new google sheet I have these formulas :

=Query(ImportRange("ehd54...dfdfg", "'Sheet1'!A:C"),"Select * Where Col1 = 'COM' limit 5" ,1)")

=Query(ImportRange("ehd54...dfdfg", "'Sheet1'!A:C"),"Select * Where Col2 contains 'IS_A_NAME' limit 5")

Notes:

  • I don't want to use set.Formula(Query(ImportRange(...

  • I have seen that I can do the equivalent of importrange here: Is it possible to do ImportRange in Google Apps Script? but I am blocked for Query.

  • my importrange sheets have about 30,000 rows and less than 5 columns.

回答1:

Once you've "imported" the data, use the 2D Array Library to filter it, then write the results to your sheet.