Hi,
I need to create a functionality similar to SQL RANK and only pick records with RANK=1
Following table is just an example of what I'm trying to do. In key field I have "AAA" repeated three times. Starting from the first record in the data set (order matters ) I need to assign rank 1,2,3,etc to each record.
The goal is to decide which records to keep and which ones to ignore when there are duplicate keys (the first incident is the valid record all others should be ignored)
Key | Rank |
AAA | 1 |
BBB | 1 |
CC | 1 |
AAA | 2 |
AAA | 3 |
BBB | 2 |
DDD | 1 |
EEE | 1 |
After assigning RANK to each record then I will pick only those records with RANK=1
Key | Rank |
AAA | 1 |
BBB | 1 |
CC | 1 |
DDD | 1 |
EEE | 1 |