Hi ,
I have a issue in creating a rank of a employee who made sales of different products and we need to find the rank of emp with major sales.
Load * inline[
Emp; Sales,prod, sales_id
A,111, bags,1
A,125, PEN,2
B,336,PEN,3
C,225,book,4
D,225,pen,5]
I was using aggr(rank(sum(sales),Emp) able to get the rank correctly when you have same amount with single sales_id but with two id's the rank is not appropriate in total. below is what i am getting
oUTPUT:
Emp Sales Rank
B ,336,1
A,336,2
C,225,3-4
D,225,3-4
Expected output is
Emp Sales Rank
B ,336,1
A,336,1
C,225,3-4
D,225,3-4
Kindly help me in getting desired output