Home > Enterprise >  Google Sheets : simple query with pivot clause
Google Sheets : simple query with pivot clause

Time:03-17

I can't find a way to simplify a query to get a similar result to a pivot. Although a pivot table is easy, I would prefer to use a query because I can then personalise headers.

Here's the link with the data :

enter image description here

CodePudding user response:

Try

={"Status","Count(Categories)";transpose(query(unique(B:C),"select count(Col2) where Col2 is not null pivot Col1",1))}

enter image description here

CodePudding user response:

if you want to pivot C column it should be:

=QUERY({Data!A1:C, Data!C1:C}, 
 "select Col2,count(Col3) where Col1 is not null group by Col2 pivot Col4", 1)

enter image description here

  • Related