Home > OS >  How to add label tag in Google Sheets Query
How to add label tag in Google Sheets Query

Time:07-09

I want to add a label to each of the columns generated by this query on a Google Sheets spreadsheet (see screenshot). However, when adding the label tag I get a parse error.

This is my attempt:

=query('6. Calendario 2022'!$C3:$E,"select E label E 'Col1' label C 'Col2', count (C) where C='Junio' and E is not null group by E") 

Where does the label tag have to be added? What am I missing here?

enter image description here

CodePudding user response:

You are missing 3rd parameter of Query (number of headers). Also labels should be at the end of your formula:

Also when you use aggregation (like count(C) ), you should use the same form when defining a label.

=query('6. Calendario 2022'!$C3:$E,"select E , count (C) where C='Junio' and E is not null group by E label E 'Col1', count(C) 'Col2'") 
  • Related