0
votes

I'm trying to run a simple query to condense a list of information from a column (which contains a consistent data type), removing blanks. I have the following code:

=query({Z:Z},"select * WHERE NOT Z =''")

This produces the error: Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: Z.

I've encountered similar issues with query elsewhere - for some reason not yet figured out by my brain, my columns somehow don't exist. I've tried using col26, col1, and everything between col1 and col30, to no avail. While I could workaround this particular simple situation with more of a filter() function, I'd like to better understand why my column's aren't computing. I'd appreciate any clarification on this.

2

2 Answers

2
votes

Try this:

=query({Z:Z},"select * WHERE Col1 is not null")

When using curly brackets {} instead of normal ones () you can not use the column letters any more but the number of the column.

Example: When you have =query({D1:F10},"select * WHERE Col3 is not null") it means F is not null (D=Col1, E=Col2, F=Col3)

0
votes

you can either use:

=QUERY({Z:Z}, "where Col1 !=''")

or:

=QUERY(Z:Z, "where Z !=''")