Quantcast
Channel: Data Preparation & Blending discussions
Viewing all articles
Browse latest Browse all 4999

Adding Ranking column to a dataset

$
0
0

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)

 

KeyRank
AAA1
BBB1
CC1
AAA2
AAA3
BBB2
DDD1
EEE1

 

After assigning RANK to each record then I will pick only those records with RANK=1

 

KeyRank
AAA1
BBB1
CC1
DDD1
EEE1

Viewing all articles
Browse latest Browse all 4999

Trending Articles