Project

GetDistinctRank

The GetDistinctRank function computes the distinct rank within each partition of a table based on the specified order column. It adds a new column containing the distinct rank for each row within its partition. The function involves grouping the

Empty image or helper icon

GetDistinctRank

Description

The GetDistinctRank function computes the distinct rank within each partition of a table based on the specified order column. It adds a new column containing the distinct rank for each row within its partition. The function involves grouping the data, adding an index column, expanding the table, sorting, computing the distinct rank, and removing intermediate columns. An example usage is provided for clarification.

Content