Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have multiple labels in a query formula?

Currently I have this formula :

   =QUERY(A:C,"select SUM(B), SUM(C) where A = date """&text("26/10/2017","yyyy-mm-dd")&""" label SUM(B) '', label SUM(C) '' ")

And this formula gives me an error if I put a second label. The formula works with just one selection and one label, but not with two.

I didn't find an alternative to this approach when searched?

I also tried to have just :

label sum SUM(B) '', SUM(C) ''

How can I have multiple labels, any ideas?

like image 912
user1866925 Avatar asked Jan 29 '23 07:01

user1866925


1 Answers

Correct syntax is:

=QUERY(A:C,"select SUM(B), SUM(C) where A = date '"&text("26/10/2017","yyyy-mm-dd")&"' label SUM(B) '', SUM(C) ''")

If you put label one time, it will work with next comma-separated list.

like image 61
Max Makhrov Avatar answered Jan 31 '23 23:01

Max Makhrov