cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How To Generate Rank with Partitions

vaidyarm
Contributor

Hi

I need to generate the rank for the below data where data should be partitioned by No and Date order by value and want to get the top 3 ranked categories for each No and each Month.

Input :

No Category  Date     Value   Rank
1   Dog     01-01-2022  32  
1   Rabbit  01-01-2022  95  
1   Fish    01-02-2022  4 
1   Ox      01-02-2022  23  
2   Cat     01-01-2022  4 
2   Mouse   01-01-2022  12  
2   Woman   01-02-2022  66  
2   Man     01-02-2022  56  
3   Bird    01-01-2022  54  
3   Bee     01-01-2022  43  
3   Cow     01-02-2022  32  
3   Pig     01-02-2022  89  	

Expected Output :

No Category  Date      Value Rank
1   Rabbit  01-01-2022  95    1
1   Ox      01-02-2022  23    1
1   Dog     01-01-2022  32    2
1   Fish    01-02-2022  4     2
2   Mouse   01-01-2022  12    1
2   Woman   01-02-2022  66    1
2   Cat     01-01-2022  4     2
2   Man     01-02-2022  56    2
3   Bird    01-01-2022  54    1
3   Cow     01-02-2022  32    1
3   Bee     01-01-2022  43    2
3   Pig     01-02-2022  89    2
5 REPLIES 5

csanka
New Contributor

Please provide expression to get rank on column "Value". Tried with above expression and getting error.