I read that to mean that you want the average of the three best values in allocation::module grade for a given student. I am further assuming that Module grade is a number, A = 4, B = 3, C = 2, ...
First, double click the line between student and allocation. Select a sort order for allocation that sorts by module grade in descending order.
Let ( [Best3 = LeftValues ( List ( allocation::module grade ) ; 3 ) ; // get up to best 3 grades in return separated list
Best3 = Left ( Best3 ; Length (Best3) - 1 ) ; //Strip off extra return added by LeftValues function
cnt = ValueCount ( Best3 )
Evaluate ( "sum ( " & Substitute ( Best3 ; ¶ ; " ; " ) & " ) " ) / cnt
Note: if there are only two grades in Best3, the average is computed by dividing by 2
Wow! The perfect solution and a description even I, as an FM novice, could follow. Thanks a lot, PhilModJunk. A life saver.