Create a set with your years dimension and your patient dimension.
Place this set on the details shelf.
Set your rank to Compute using the Set.
Thanks for your reply. I am not sure if I am doing it right but I am getting the same result. I created a set with all my years and patients. Then used the top 10 set to compute on this "all" set.
Actually, I did find the answer to this. You have to create an index to rank your patients based on total episodes. Then create a parameter to select the n rank. Create a filter of your date field and that should do it. Thanks,