Search code examples
google-sheetsformulasgoogle-query-language

How can I import data using query and group it by row values?


I have a table with data which is structured like this: table1

Is it possible to transform my table to table like this using query? table2


Solution

  • If there is a possibility of repeated weights, would need to do something like this

    =ArrayFormula(query({row(A2:C5),A2:C5},"select Col3,max(Col4) group by Col1,Col3 pivot Col2"))