6 Replies Latest reply: Oct 24, 2017 11:12 AM by Frédéric Villemin RSS

    Adding rank based on 1 dimension in the script

    Frédéric Villemin

      Hello,

       

      I have a table of sales with two dimensions called Country and Customer and a KPI called Amount.

       

      I would like to add in this table, for each line, the rank of the customer based on the total amount of this Customer in this Country

      For example :

       

      Germany, Google, 10

      Germany, Google, 5

      Germany, Apple, 1

      Germany, Microsoft, 100

      Belgium, Microsoft, 50

       

      would become :

       

      Germany, Google, 10, rank 2

      Germany, Google, 5, rank 2

      Germany, Apple, 1, rank 3

      Germany, Microsoft, 100, rank 1

      Belgium, Microsoft, 50, rank 1

       

      How can I do that in scripting ?

      Thanks