Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Remove "0" value results from QUERY

enter image description here

This is the data set

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

This is the formula I am using to query.

=QUERY(A:B, "SELECT A, SUM(B) WHERE A <> '' GROUP BY A")

I want the end results to remove the asset if the sum amount is =< 0.

i.e. ABC would not show in query.

>Solution :

Try adding a new condition where SUM(B) is >0

=QUERY(A:B, "SELECT A, SUM(B) WHERE A <> '' AND SUM(B) >0 GROUP BY A")

UPDATE

Sorry, then you’ll need to wrap it in another QUERY:

=QUERY(QUERY(A:B, "SELECT A, SUM(B) WHERE A <> '' GROUP BY A"),"WHERE Col2 >0")

Try it and let me know

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading