Sorting, grouping and adding by multiple keys

Hello,
i’m trying to get the following:

sort order by index 1>2>3
then group and summ value from index 0

in order to have the following list:

2
V20
200
150

4
V30
125
200

3
V30
175
125

Thanks

The basic idea is to sort and group then sort sub-levels. There are a ton of similar topics already discussed on the forum. See if you can find one that already has a solution and implement something similar. Then you can always post questions for specific issues you run into.