I'm using FILTER
to extract rows from a range, and want to take only certain columns. For example, I filter by D, but want only columns B,C in reverse order. I tried to use QUERY
:
=QUERY(filter(B:D,D:D>=2), "select C,B")
- Error: can't analyze query string for function QUERY parameter 2: NO_COLUMNC=QUERY(filter(B:D,D:D>=2), "select *")
- shows me all columns, so QUERY
should work...
How do I QUERY
the results of FILTER
? Any other way to achieve this?
Copy the single column or subset to an out of the way spot so you can sort it separately from the source spreadsheet. To do this, select the column you want to sort by clicking the column's header cell. Next, choose Filter from the Data menu and then select Advanced Filter.
To select non-adjacent rows or columns, hold Ctrl and select the row or column numbers.
When you are QUERYing a computed array, you need to use the Colx notation rather than column letters:
=QUERY(FILTER(B:D,D:D>=2),"select Col2, Col1")
which incidentally can be achieved by just using the QUERY:
=QUERY(B:D,"select C, B where D >= 2")
or just FILTER:
=FILTER({C:C,B:B},D:D>=2)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With