Feature suggestion: additional aggregations in the GroupBy node

Hi

I would appreciate the following aggregation(s).

  • row_number: Returns the number of the current row within its partition, counting from 1.
  • rank: Returns the rank of the current row, with gaps; that is, the row_number of the first row
    in its peer group.
  • dense rank: Returns the rank of the current row, without gaps; this function effectively counts peer
    groups.

I took the description from PostgreSQL.

Cheers

Thiemo

Hi @Thiemo.Kellner , I’m not sure I can see how that would work within the GroupBy node.

All of the aggregations currently within the GroupBy node create summary information across the defined groupings. If you had one “pseudo-aggregation” such as rank which returned a value per row, it would struggle to return sensible results if at the same time we also requested a sum of all rows, or another calculation such as a max/min.

I think this is probably why ranking functions similar to what you describe were split out into the separate Rank node (albeit that I find the UI for that particular node to be less than friendly :wink: and it has the odd quirk).

1 Like

@takbb Oh, I see I forgot to look for a specific ranking node. My bad. And you are right. What I described or aimed at are windowing functions (at least in SQL world).

1 Like

Ah yes, I see where you are coming from as those sql windowing/analytics functions do incorporate both aggregations and ranking operations.