1
votes

I am using a query formula to import data from a different sheet. However, after querying the data, I only need it to show data with value only. How to remove data without value when I query?

My query formula is the following:

=QUERY(Paste!A:G,"SELECT A,B,C,D WHERE B ='"&$C$6&"' or B ='"&$C$7&"' or B ='"&$C$8&"' or B ='"&$C$9&"' or B ='"&$C$10&"' or B ='"&$C$11&"' ORDER BY D DESC")

My spreadsheet link is the following:

https://docs.google.com/spreadsheets/d/1A6lGIlU147Y_0WFD7Btkq4IMuY-Z3D1HsNiTgjLjm0o/edit?usp=sharing

enter image description here

At above image can see data without value also showing. I want to Query data with value only.

1

1 Answers

2
votes

use:

=QUERY(Paste!A:G, 
 "select A,B,C,D 
  where D <> 0 
    and D is not null
    and (B ='"&$C$6&"'
     or B ='"&$C$7&"' 
     or B ='"&$C$8&"'
     or B ='"&$C$9&"'
     or B ='"&$C$10&"' 
     or B ='"&$C$11&"') 
  order by D desc")

0