How to have multiple labels in a query formula?
Asked Answered
D

1

8

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?

Deeplaid answered 31/10, 2017 at 8:44 Comment(0)
S
14

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.

Swap answered 31/10, 2017 at 9:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.