Implement ROW_NUMBER/RANK within GROUP

Comments

3 comments

  • Joel Stewart

    Hi James, it sounds like you're simply trying to sort the results within a sheet. This is described in detail in our documentation: Sorting Data

    Please note that sorting a column or using functions like GROUP_SORT_ASC will have a performance impact for larger data sets. This is expected and it is recommended to only sort when absolutely required (i.e. only on the final sheet). Allowing intermediate results to remain unsorted where possible can reduce the performance overhead required to add sorting. 

    0
    Comment actions Permalink
  • Wasserman, Rock

    "it sounds like you're simply trying to sort the results within a sheet"

    Ranking is used for more than just sorting. It is also for filtering and for grouping by decile/percentile/etc. It is a very useful function. Is there a way to mimic the behavior of the rank() or row_number() functions from SQL in Datameer?

    Thanks 

    0
    Comment actions Permalink
  • Alan Mark

    Hi Rock,

    We've got a KB article on getting row numbers here: How to Add Row Numbers to a Sheet

    You can also use GROUPROWNUMBER after a GROUPBY on your column that you want to rank to get similar functionality to RANK.

    0
    Comment actions Permalink

Please sign in to leave a comment.