1

I'm trying to pull a column of data from a file if two conditions are met.

If I write the formula with one condition works perfectly =QUERY(IMPORTRANGE("url", "PIP!A2:S"), "SELECT Col2 WHERE Col3 = 'Schedule Change'")

But if I add a second condition with an AND clause it breaks =QUERY(IMPORTRANGE("url", "PIP!A2:S"), "SELECT Col2 WHERE Col3 = 'Schedule Change' AND Col8 IS NOT 'Closed'")

This is the error Unable to parse query string for Function QUERY parameter 2: PARSE_ERROR: Encountered " "Col8 "" at line 1, column 47. Was expecting one of: "(" ... "(" ...

Can't share the url cause is data from my company, but if you could help me sort this one out

Angelo

player0
  • 124,011
  • 12
  • 67
  • 124
AngelCel
  • 13
  • 3

1 Answers1

0

only is not null is supported otherwise you need to do it like this:

=QUERY(IMPORTRANGE("url", "PIP!A2:S"), 
 "select Col2 
  where Col3 = 'Schedule Change' 
    and not Col8 = 'Closed'")

or:

=QUERY(IMPORTRANGE("url", "PIP!A2:S"), 
 "select Col2 
  where Col3 = 'Schedule Change' 
    and Col8 <> 'Closed'")

or:

=QUERY(IMPORTRANGE("url", "PIP!A2:S"), 
 "select Col2 
  where Col3 = 'Schedule Change' 
    and Col8 != 'Closed'")
player0
  • 124,011
  • 12
  • 67
  • 124
  • The first option worked like a charm, the second didn't not sure why. And I didn't even try the 3rd having 1st one working. – AngelCel Oct 19 '22 at 08:31