简体   繁体   中英

Google Sheet Query SUM exclude all SUM equal zero

cracking brain for this.

I have a very simple query with group and sum, and I want to exclude all sum results that are zero.

My actual query is:

=query(A:J;"SELECT D, SUM(I), SUM(H) WHERE C<>'S' GROUP BY D ORDER BY D DESC")

So.. I know I cant do something like this:

=query(A:J;"SELECT D, SUM(I), SUM(H) WHERE C<>'S' AND SUM(I)>0 GROUP BY D ORDER BY D DESC")

I'm trying with query inside filter, query inside query, but I can't figure out how to solve it.

try:

=QUERY(QUERY(A:J; 
 "select D,sum(I),sum(H) 
  where C<>'S' 
  group by D 
  order by D desc"); 
 "where Col2>0"; 1)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM