I've created a Google Sheets function, with the intended effect of getting the sum of numeric values between two dates, where the value in a different column is equal to a string. The calculation however is having unintended side-effects.
The problem is that the function starts out by returning the string value "sum" to the cell, before returning the actual result of the calculation onto a second row.
How can I limit the QUERY function in Google Sheets to only return the value of the calculation I'm querying for?
=QUERY('Finance, raw data'!A2:D;"SELECT SUM(C) WHERE D='Audible' AND A >= date '2021-08-01' AND A < date '2021-09-01'")