Let's say a table A:
Year product rating
07/02/2018 A good
07/02/2017 B good
07/02/2016 A bad
07/02/2015 C medium
07/02/2016 C bad
In a first phase, I wish to obtain the following table:
product year score
A 07/02/2018 1
A 07/02/2016 3
B 07/02/2017 1
C 07/02/2016 3
C 07/02/2015 2
The second phase:
product year score for oldest date
A 07/02/2016 3
B 07/02/2017 1
C 07/02/2015 2
what is the shortest way to do this ? ( ranking, change scores from strings to numbers, aggeregate). Can I do all these steps in one shot ?
Thank you