I want QUERY command to provide me with the sum of two columns, and group the result by Column A.
The following is not working (parsing error)
=query(Ledger!A2:G,"SELECT A, sum(D+E) where (B = ...) group by A order by A")
... neither is this (empty results)
=query(Ledger!A2:G,"SELECT A, sum(D)+sum(E) where (B = ...) group by A order by A ")
I can, of course, use the query below, and sum the columns using the =SUM()
command, but I would rather have the query already return the sum of both columns.
=query(Ledger!A2:G,"SELECT A, sum(D), sum(E) where (B = ...) group by A order by A")
based on this, and this, my query should be working, but it is not. Why? Any workaround (that does not involve array formulas or using the =SUM()
function?