Hello, I have this panel data.

Array

I want to rank the variable (REV_CH_mean5) within each industry-year ( Year IndustryCode). Then, firms (Stkcd) with values of the variable in the highest quintile are assigned a score of 5, those in the next quintile receive a score of 4, etc., and those in the lowest quintile are assigned a score of 1.