This is with what I came up. The point is to first define the initial group of variables as JSON path, then ungroup them, and then extract the stats as additional JSON paths and then treat them again with JSON paths and use Pivot to ‘transpose’ them. Finally joining the information together by the school (name).
With the ID I used a missing value node since I was not exactly sure how to handle them.
PS.: welcome to the KNIME forum
kn_example_json_ungroup_pivot.knwf (53.7 KB)