instead A79:H86
you will put your query from your image, then adjust G79:G86
to fit the virtual array construct and also adjust {2,9}
add more columns (like those hidden ones) and then, of course, adjust Cols
if you added more stuff in {2,9}
=ARRAYFORMULA(QUERY({IFERROR(VLOOKUP(QUERY(QUERY(
{A79:H86},"select Col7, sum(Col3) group by Col7 label sum(Col3)''",0),
"select Col1",0),{G79:G86,A79:H86},{2,9},0), ),
QUERY({A79:H86},"select Col7, sum(Col3) group by Col7 label sum(Col3)''",0),
QUERY({A79:H86},"select sum(Col4) group by Col7 label sum(Col4)''",0)},
"select Col1, Col4, Col5, Col3, Col2 order by Col2",0))
to sum only Col3:
=ARRAYFORMULA(QUERY({IFERROR(VLOOKUP(QUERY(QUERY(
{A79:H86},"select Col7, sum(Col3) group by Col7 label sum(Col3)''",0),
"select Col1",0),{G79:G86,A79:H86},{2,9},0), ),
QUERY({A79:H86},"select Col7, sum(Col3) group by Col7 label sum(Col3)''",0)},
"select Col1, Col4, Col3, Col2 order by Col2",0))