Search code examples
google-sheetsgoogle-sheets-formulagoogle-sheets-querygoogle-query-language

How to run query to only pull data if specified column contains values


The query on the DATA sheet should only pull data if specified sheets contain any value in column 3. If there is no value in column 3 then no data should appear on the query.

I have tried to type "CONTAINS VALUE" but that did not work.

https://docs.google.com/spreadsheets/d/1CMcxSP86Zc8FajecJmVwlgfe3ComQXUQYpfssjbcyBY/edit?usp=sharing

I am getting an error message

=QUERY({'Alex English'!A3:AF;'Zack Jones'!A3:AF;'Aaron Schafer'!A3:AF; 'Abigail Myer'!A3:AF;'Andrew Megronigle'!A3:AF;'April Baker'!A3:AF;'Cameron Staley'!A3:AF;Blank2!A3:AF;'Christin Pylant'!A3:AF;'Chris Burgos'!A3:AF;'Cody Sullivan'!A3:AF;'Colin Pomet'!A3:AF;'Daniel Probst'!A3:AF;Blank!A3:AF;'David Smith'!A3:AF;'Destini Walker'!A3:AF;'George Flores'!A3:AF;'James Murphy'!A3:AF;'Jennifer Piatt'!A3:AF;'Jesse Camire'!A3:AF;'Joel Endel'!A3:AF;'Jordan Richardson'!A3:AF;'Josh Gionti'!A3:AF;'Josh Mech'!A3:AF;'Juan Ortiz'!A3:AF;'Justin Kopka'!A3:AF;'Justin Sanders'!A3:AF;'Kaitlyn Beatty'!A3:AF;'Kevin Lora'!A3:AF;'Kyle Fallon'!A3:AF;'Kyle Silverstein'!A3:AF;'Matthew Nussbaum'!A3:AF;'McKenna Benz'!A3:AF;'Michelle Bullard'!A3:AF;'Michelle Marcos'!A3:AF;'Oliver Santry'!A3:AF;'Ruben Loyo'!A3:AF;'Ryan DelFavero'!A3:AF;'Ryan Kennedy'!A3:AF;'Ryan Morgenlander'!A3:AF;'Shawn Ramrup'!A3:AF;'Tara Knothe'!A3:AF;'Todd Worthington'!A3:AF;'Wesley Miller'!A3:AF;'Zach Coldiron'!A3:AF},
 "select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8,Col9,Col10,Col11,Col12,Col13,Col22 
  where Col3 CONTAINS VALUE", 1)

Solution

  • what you need is: is not null

    =QUERY({'Alex English'!A3:AF;'Zack Jones'!A3:AF;'Aaron Schafer'!A3:AF; 'Abigail Myer'!A3:AF;'Andrew Megronigle'!A3:AF;'April Baker'!A3:AF;'Cameron Staley'!A3:AF;Blank2!A3:AF;'Christin Pylant'!A3:AF;'Chris Burgos'!A3:AF;'Cody Sullivan'!A3:AF;'Colin Pomet'!A3:AF;'Daniel Probst'!A3:AF;Blank!A3:AF;'David Smith'!A3:AF;'Destini Walker'!A3:AF;'George Flores'!A3:AF;'James Murphy'!A3:AF;'Jennifer Piatt'!A3:AF;'Jesse Camire'!A3:AF;'Joel Endel'!A3:AF;'Jordan Richardson'!A3:AF;'Josh Gionti'!A3:AF;'Josh Mech'!A3:AF;'Juan Ortiz'!A3:AF;'Justin Kopka'!A3:AF;'Justin Sanders'!A3:AF;'Kaitlyn Beatty'!A3:AF;'Kevin Lora'!A3:AF;'Kyle Fallon'!A3:AF;'Kyle Silverstein'!A3:AF;'Matthew Nussbaum'!A3:AF;'McKenna Benz'!A3:AF;'Michelle Bullard'!A3:AF;'Michelle Marcos'!A3:AF;'Oliver Santry'!A3:AF;'Ruben Loyo'!A3:AF;'Ryan DelFavero'!A3:AF;'Ryan Kennedy'!A3:AF;'Ryan Morgenlander'!A3:AF;'Shawn Ramrup'!A3:AF;'Tara Knothe'!A3:AF;'Todd Worthington'!A3:AF;'Wesley Miller'!A3:AF;'Zach Coldiron'!A3:AF},
     "select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8,Col9,Col10,Col11,Col12,Col13,Col22 
      where Col3 is not null", 1)
    

    0