2 Replies Latest reply: Sep 1, 2016 5:36 PM by Sunny Talwar RSS

    Ranking in the script

    Łukasz Liziniewicz

      Hello,

       

      I have such data set:

      LOAD

        *

        INLINE

        [

        MONTH, SALESMAN, SALES_VALUE

        201501, BEN, 10

        201501, ANN, 20

        201501, JAC, 5

        201502, BEN, 100

        201502, ANN, 20

        201502, JAC, 50

        201503, BEN, 5

        201503, ANN, 20

        201503, JAC, 1

        ];

       

      I need to rank the salesman in each month (from the highest sales value). In result I expect the table as below:

       

      MONTH SALESMAN SALES_VALUERANKING
      201501 BEN102
      201501 ANN201
      201501 JAC53
      201502 BEN1001
      201502 ANN203
      201502 JAC502
      201503 BEN52
      201503 ANN201
      201503 JAC13

       

      Any ideas?