9 Replies Latest reply on Nov 28, 2012 7:18 AM by Max Mozgovoy

    How to count a max value for each row, and return its position in a table?

    Max Mozgovoy

      Hi,

       

      my data looks like a table of Customers IDs and a number of purchases in different product categories (Columns 1 to 70).

       

      IDColumn1Column2
      ...
      Column69
      Column70MaxValueInARowMaxPosition
      ID1017...41172 (or Column2)
      ID232...1501569 (or Column 69)
      ........................
      IDn254...132251 (or Column 1)



      ...



       

      I need for every customer (from 1 to N) create 2 calculated fields:

      - first (MaxValueInaRow): should return the maximum value for the purchases for each customer ID,

      - second (MaxPosition): should return the position of the category (column ID) for this maximum value

       

      Can you please give some hint on how to do that?

      Any help will be greatly appreciated!

      Thanks!