Top N per-group

Description

Select for each group the top-N results. This blocks requires a list of pairs [OBJ,OBJ] as the input. The groups are created on the first column, thus the second column is grouped by the first. The results are also returned as a list of pairs. Thus, each member of the group as a separate result.

Input

  • SOURCE [OBJ,OBJ]: the list of objects pairs to filter. Distinct values in the first column identify groups

Output

  • RESULT [OBJ,OBJ]: the top-N objects for each group

Parameters

  • N: the number of results to return