Welcome to the ODK forum, @Richa_Agarwal! We're glad you're here. When you get a chance, please introduce yourself on this forum thread. I'd also encourage you to add a picture as your avatar because it helps build community!
What you tried sounds like it should work, or is very close!
Here's a working example: cascading_rank.xlsx (11.7 KB)