Hi,
To understand the Rank function in webi see attached webi user guide.
section 26.1 Ranking data (Page 307)
http://help.sap.com/businessobject/product_guides/boexir4/en/xi4_ia_en.pdf
Share some screenshots of your webi issue to get more understanding of the issue.
In the first table i have used rank by Year Top.
=Rank([Margin];Top;[Year])
in the second table rank on measure only.
=Rank([Margin])
Amit