Is there a way for a query to output unsorted? By default, it sorts the data.
I tried adding a helper column that adds the row number to the query input, but then it is not part of "select" like this:
=QUERY({Data!A1:C24,ArrayFormula(if(Data!A1:A24<>"",row(Data!A1:A24),""))},"Select Col1, Sum(Col2) group by Col1 pivot Col3 order by Col4")
Here is a sample sheet: https://docs.google.com/spreadsheets/d/1bMdCQKeWKqXI2Mmwpu__lHsGO2OttbJArWusBS8BMyQ/edit?usp=sharing
The desired output is that the query should show the points sum first for Apple, Orange, Banana etc.