2 Replies Latest reply: Feb 2, 2012 1:53 PM by Ashutosh Paliwal RSS

    Ranking in script

    Daniel Fleisher

      I want to do some ranking in my script, by a dollar amount field. Usually it's pretty simple - just order by the Amount field, and use RowNo. However, in this case, it's a bit more complex. Let's say I have two different departments. here's how my data would look:

       

      Dept     Amount

      A          5

      B          7

      A          10

      A          1

      A          6

      B          4

      B          20

      A          15

      B          12

      B          8

       

       

      I want to have a separate ranking for each Department - so A should have rankings 1 - 5 and B should also have 1 - 5, instead of just having 1 - 10 over the whole thing.

       

      Any thoughts?